Shoutbox

Determing if message was first sent? - 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: Determing if message was first sent? (/showthread.php?tid=85357)

Determing if message was first sent? by Zero on 08-13-2008 at 03:56 AM

I've been trying to figure out how I'd be able to determine if a received message was the first received message in the current chat window, but I can't seem to figure out a graceful way of doing this. Can anyone suggest/flesh out how I might go about it?

Zero


RE: Determing if message was first sent? by roflmao456 on 08-13-2008 at 04:17 AM

code:
var ChatWnds = new Array();
function OnEvent_ChatWndCreated(ChatWnd){
ChatWnds.push(ChatWnd);
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
if(Origin !== Messenger.MyName){
for(i in ChatWnds){
if(ChatWnd === ChatWnds[i]){
// first message received..
}
}
}
}

could try that, haven't tested it since i'm currently skinning :P
RE: RE: Determing if message was first sent? by segosa on 08-13-2008 at 09:48 AM

quote:
Originally posted by roflmao456
code:
var ChatWnds = new Array();
function OnEvent_ChatWndCreated(ChatWnd){
ChatWnds.push(ChatWnd);
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
if(Origin !== Messenger.MyName){
for(i in ChatWnds){
if(ChatWnd === ChatWnds[i]){
// first message received..
}
}
}
}

could try that, haven't tested it since i'm currently skinning :P

just need to make sure you set ChatWnds[i] to null in that if, otherwise the next message will be seen as the first too.
RE: Determing if message was first sent? by Zero on 08-14-2008 at 07:54 PM

mmmm... ok. i think i follow. not entirely sure so I'll need to experiment a bit once i'm back in front of my computer. thanks!