Shoutbox

Get recipients email & name using ChatWndSendMessage - 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: Get recipients email & name using ChatWndSendMessage (/showthread.php?tid=71857)

Get recipients email & name using ChatWndSendMessage by Bolter99 on 02-17-2007 at 03:45 PM

Im making a conversation logger using AJAX to send it to a url, where its then inserted into a sql database. So far its all working perfectly i just need to figure out how to send the name & email of the contact to the server.

Somthing using the ChtWnd object i presume but i dont know where to start.

Somthing like this, if only it worked :p

code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
Debug.Trace(ChatWnd.RecipientsName);
}


Ill try and do it myself and ill post my solution here if i work it out myself.

Any help appreciated!
RE: Get recipients email & name using ChatWndSendMessage by hmaster on 02-17-2007 at 03:50 PM

I think you can use this:

code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
     var Contacts = ChatWnd.Contacts;
     var e = new Enumerator(Contacts);
          for(; !e.atEnd(); e.moveNext()) {
               var Contact = e.item();
               Debug.Trace(" " + Contact.Email);
               Debug.Trace(" " + Contact.Name);
          }
}
It should get all participants in a conversation.

Edit: Thanks vikke.
RE: RE: Get recipients email & name using ChatWndSendMessage by vikke on 02-17-2007 at 03:57 PM

quote:
Originally posted by hmaster
I think you can use this:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
     var Contacts = ChatWnd.Contacts;
     var e = new Enumerator(Contacts);
          for(; !e.atEnd(); e.moveNext()) {
               var Contact = e.item();
               Debug.Trace(" " + Contact.Email);
          }
}
It should get all participants in a conversation.

That displays the email, if you want their nickname instead use:
Contact.Name
and their PSM:
Contact.PersonalMessage

You can find more here:
http://www.mpscripts.net/docs.php
RE: Get recipients email & name using ChatWndSendMessage by Bolter99 on 02-17-2007 at 04:13 PM

I need to show just the one... Or ill get a list on the mysql database or just the words "[object]" wont i?

I can probabbly work the rest out myself though.

Anyways, thanks a lot!!! :D

EDIT: Yup got it working now.


RE: Get recipients email & name using ChatWndSendMessage by vikke on 02-17-2007 at 04:39 PM

If you sent only Contact, it would be [object].