Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
FrostSteiger #1
Member since Nov 2007 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Problems past one open IM window
Hello, first wanted to say thank you for making a great SDK, it has been really helpful and the coding example is wonderful.

I have my application working and it will connect to google and can chat with my contacts and such. The problem comes with incoming messages being handled properly. I was wondering how logically... you take a message coming in and how you send it to the proper instance of the chat form.

I have an OnMessage event on my main program code that handles the message coming in but im confused on how you only open one chat form per contact messaging you and then how you send messages only from that contact to the proper form.

I tried just sloppily copying and pasting the MiniClient OnMessage coding into my own but it would only open a new window for each message sent to me.

Any help would be greatly appreciated. Also any resources relating to this would be great to if anyone knows on hand.
Avatar
FrostSteiger #2
Member since Nov 2007 · 2 posts
Group memberships: Members
Show profile · Link to this post
ok, i actually fixed the issue where the message would go to the right window, but now im having trouble getting a window to pop up just once per new incoming message.

Like:
userX sends you a message, program should open up windowX
userY sends you a message, program should open up windowX
userX then sends another message, message goes to windowX
you close windowX
userX sends you a message, program should open up windowX again


What sort of programming logic am i missing. I tried copying the onMessage method directly to my own and it didnt open a fresh window on incoming message... 

Thanks for any help!
Avatar
Alex #3
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

you need some collection/hastable which stores all open chat windows by Jid with a reference to the form.
If you take a look at the MiniClient you will find some examples there.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS