Shoutbox

Block/unblock in a multiple conversation? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Block/unblock in a multiple conversation? (/showthread.php?tid=66546)

Block/unblock in a multiple conversation? by Robin4286 on 09-22-2006 at 11:23 PM

Okay, so what I want to do is just to block all contacts in a conversation, but just that conversation. I also want to be able to unblock them as well. I dont wish promptts to constantly appear, because the conversation will have 3+people in it. Is there a way you can block/unblock them?

I tried sending /block, but that just makes a prompt appear when there are multiple people.

Can anyone help?
Thanks in advance!


RE: Block/unblock in a multiple conversation? by Spunky on 09-22-2006 at 11:50 PM

@Chris4: POST DELETED ;)

@Robin4286: It is possible to block all the people in a group chat. It just requires iterating through the contacts in the current chat window. You should be able to block/unblock them easily enough. However, you may run into an error if there is a contact in the conversation that is not in your own contact list. This should be pretty simple to get around though :p

EDIT: I'll knock something up quickly and post it here when I'm done


RE: Block/unblock in a multiple conversation? by matty on 09-23-2006 at 01:07 AM

code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
    if (sMessage == '/mblock'){
        for(var enumerator = new Enumerator(pChatWnd.Contacts) ; !enumerator.atEnd(); enumerator.moveNext()){
            enumerator.item().Blocked = true;
        }
        return '';
    }
    else if (sMessage == '/munblock'){
        for(var enumerator = new Enumerator(pChatWnd.Contacts) ; !enumerator.atEnd(); enumerator.moveNext()){
            enumerator.item().Blocked = false;
        }
        return '';
    }
}

RE: Block/unblock in a multiple conversation? by CookieRevised on 09-23-2006 at 01:24 AM

quote:
Originally posted by SpunkyLoveMuff
However, you may run into an error if there is a contact in the conversation that is not in your own contact list.
it shouldn't though, as you can put people on your block list without them being on your contact list.
RE: Block/unblock in a multiple conversation? by Spunky on 09-23-2006 at 10:42 AM

quote:
Originally posted by CookieRevised
it shouldn't though, as you can put people on your block list without them being on your contact list.

I have noticed problems before trying to read properties (and therefore set properties?) with contacts notsaved on my own list. I guess I was beaten to the code... I kinda went to bed and was planning to do it now... :p