What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [REQUEST] Group chat monitor...er?

[REQUEST] Group chat monitor...er?
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [REQUEST] Group chat monitor...er?
Javascript code:
var oChatWnd = {};
 
function OnEvent_ChatWndCreated( pChatWnd ) {
    __add ( pChatWnd );
}
 
function OnEvent_ChatWndDestroyed( pChatWnd ) {
    __remove ( pChatWnd.Handle );
}
 
function OnEvent_ChatWndSendMessage( pChatWnd, sMessage ) {
    __remove( pChatWnd.Handle );
}
 
function OnEvent_Timer( sTimerId ) {
    if ( oChatWnd[ parseInt( sTimerId ) ].iSecondCounter === 120 ) {
        oChatWnd[ parseInt( sTimerId ).pChatWnd.SendMessage( 'I am currently away from my computer. This is an auto-disconnect message that occures after 2 minutes of inactivity.' );        __remove( sTimerId );
    } else {
        oChatWnd[ parseInt( sTimerId ) ].iSecondCounter++;
        MsgPlus.AddTimer( sTimerId, 1000 );
    }
}
 
function __add( pChatWnd ) {
    if ( pChatWnd.Contacts.Count ) === 1 ) return;
    oChatWnd[ pChatWnd.Handle ] = {};
        oChatWnd[ pChatWnd.Handle ].pChatWnd = pChatWnd;
        oChatWnd[ pChatWnd.Handle ].iSecondCounter = 0;
    MsgPlus.AddTimer( pChatWnd.Handle, 1000 );
}
 
function __remove( pChatWnd ) {
    if ( typeof oChatWnd[ parseInt( pChatWnd ) ] === 'undefined' ) return;
 
    var s=''    for ( var e = new Enumerator( oChatWnd[ parseInt( pChatWnd ) ].pChatWnd.Contacts ); !e.atEnd(); e.moveNext() {        s+=e.item().Email+ ( !e.atEnd() ? ', ' : '' );    }     MsgPlus.LogEvent( 'Group chat', 'A group chat session was initiated with '+s+' however was closed after 2 minutes of inactivity.', EVICON_PLUS );    MsgPlus.CancelTimer( pChatWnd );
    Interop.Call( 'user32', 'SendMessageW', parseInt( pChatWnd ), 0x10 /* WM_CLOSE */, 0, 0 );
    delete oChatWnd[ parseInt( pChatWnd ) ];
}


I dunno something like that... this closes the chat window after 2 mins of not saying anything...

This post was edited on 04-09-2009 at 01:13 PM by matty.
04-08-2009 03:25 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[REQUEST] Group chat monitor...er? - by Jigain on 04-08-2009 at 02:47 PM
RE: [REQUEST] Group chat monitor...er? - by matty on 04-08-2009 at 03:25 PM
RE: [REQUEST] Group chat monitor...er? - by Jigain on 04-08-2009 at 03:39 PM
RE: [REQUEST] Group chat monitor...er? - by matty on 04-08-2009 at 05:20 PM
RE: [REQUEST] Group chat monitor...er? - by Jigain on 04-09-2009 at 04:43 AM
RE: [REQUEST] Group chat monitor...er? - by matty on 04-09-2009 at 01:01 PM
RE: [REQUEST] Group chat monitor...er? - by Jigain on 04-10-2009 at 05:31 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On