Cool VL Viewer forum
http://sldev.free.fr/forum/

block ad-hoc chats
http://sldev.free.fr/forum/viewtopic.php?f=9&t=2014
Page 1 of 1

Author:  Mr.Tach [ 2020-04-04 00:06:31 ]
Post subject:  block ad-hoc chats

Can you add the "automatically ignore and leave all conference (ad-hoc)chats" what firestorm have?
to prevent spammers/bots adding us to their chats.
I know I can block the spammer but he make another account and again and again...

Author:  Henri Beauchamp [ 2020-04-04 08:27:36 ]
Post subject:  Re: block ad-hoc chats

No, sorry, this is too specific/exotic a feature. Beside, you can already use a few lines of Lua code to perform auto-muting of conferences initiators if it fancies you. Here is an example (to add to your automation.lua script):
Code:
known_sessions = {}

function OnInstantMsg(session_id, origin_id, session_type, name, text)
    -- If it is not a conference session or it already got dealt with, do not care
    if session_type ~= 2 or known_sessions[session_id] then
        return
    end
    -- Flag this new conference session as already dealt with
    known_sessions[session_id] = true
    -- It is a conference session, mute initiator
    -- NOTE: OnInstantMsg() always receives the legacy name in 'name'
    AddMute(name)
    -- Depending on viewer configuration, the name may get any "Resident"
    -- last name stripped off. Since we mute the initiator by name (because
    -- their UUID is sadly not passed to the viewer by the server when a
    -- conference IM is initiated), we must ensure that any new resident
    -- who got "Resident" as their last name for their avatar (case of all
    -- the griefers that register new avatars) have both "Firstname" and
    -- "Firstname Resident" registered in our mute list...
    if not string.find(name, " ") then
        -- There is no last name, so "name" is "Firstname" and we must add
        -- "Firstname Resident".
        AddMute(name .. " Resident")
    else
        local i = string.find(name, " Resident")
        if i then
            -- "name" is "Firstname Resident" and we must add "Firstname".
            AddMute(string.sub(name, 1, i - 1))
        end
    end
end

You can of course add a global flag to toggle the feature on/off. See the Lua documentation and sample script for how to do it.

I might add a Lua function to close IM sessions in a future release (which would allow to auto-close the conference in the above script).

Beside, I encourage you to abuse-report initiators of such IM conferences: this is always what I do when it happens to me, and I can tell you that LL deals promptly with the griefers using this method. So far and in all cases I could experience myself, the griefer got tired and stopped creating new accounts after a short while.

Author:  Henri Beauchamp [ 2020-04-11 14:04:04 ]
Post subject:  Re: block ad-hoc chats

With today's release and the added Lua features, you can use:
Code:
known_sessions = {}

function OnInstantMsg(session_id, origin_id, session_type, name, text)
    -- If it is not a conference session or it already got dealt with, do not care
    if session_type ~= 2 or known_sessions[session_id] then
        return
    end
    -- Flag this new conference session as already dealt with
    known_sessions[session_id] = true
    -- If not initiated by a friend, close the session and mute the initiator
    -- NOTE: OnInstantMsg() always receives the legacy name in 'name'
    if not IsAgentFriend(name) then
        CloseIMSession(session_id)
        AddMute(name)
        -- Depending on viewer configuration, the name may get any "Resident"
        -- last name stripped off. Since we mute the initiator by name (because
        -- their UUID is sadly not passed to the viewer by the server when a
        -- conference IM is initiated), we must ensure that any new resident
        -- who got "Resident" as their last name for their avatar (case of all
        -- the griefers that register new avatars) have both "Firstname" and
        -- "Firstname Resident" registered in our mute list...
        if not string.find(name, " ") then
            -- There is no last name, so "name" is "Firstname" and we must add
            -- "Firstname Resident".
            AddMute(name .. " Resident")
        else
            local i = string.find(name, " Resident")
            if i then
                -- "name" is "Firstname Resident" and we must add "Firstname".
                AddMute(string.sub(name, 1, i - 1))
            end
        end
    end
end

Author:  Henri Beauchamp [ 2020-04-12 09:42:51 ]
Post subject:  Re: block ad-hoc chats

I edited the scripts in my replies above to properly take into account avatar names with "Resident" as the last name.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/