Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Sourav #1
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: Unwanted/Reverted messages in MUC client using gmail
Hi, Alex.

I got the group chat working with gmail accounts. But I have got a couple of queries regarding its functionality.

1. When I start the group chat with somebody (another user), I get get a blank mesage ("") from the chat room JID which doesn't have any resource. Any idea why this blank message might be coming?

2. When I start a group chat and send a message to the other user, I'm getting back the same message from the other user. The MessageGrabber catches this message as "groupchat" type message coming from the chat room JID with the other user as the resource and the message is reverted back to me!
 
e.g: Suppose if "User1" sends "hi...", the same message "hi..." is reverted automatically from the "User2". So that the chat on my client app looks like this:
 
User1: hi...
User2: hi... // this message automatically comes back as a message from User2

Can you tell me the reason behind this? And how to get rid of this unwanted message?

3. When another user sends a message, the message arrives with a random number (like this : cd3bd3ffd02e7d7c) as the resource in the roomJID instead of the nick I gave that user!!!

I hope that's not too many questions together!

Thanks, again.
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
1) please post you complete Xml log.

2) This is how Muc is designed. You display only the incoming messages in your chat window. Not your outgoing mesages.

3) I also need the complete logs for this.

You can find the complete documentation for multi user chat here: http://xmpp.org/extensions/xep-0045.html

Alex
Avatar
Sourav #3
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
Hi, Alex. Thanks for the help again. Sorry, for replying a bit late. I had to take a break due to some unavoidable circumstances.
Anyway, I figured out the solutions to the first two problems but still not able to get past the third one. Here's how the XML log looks like! Not sure how helpful it would be. See if you can make something out of it. Thanks and regards!


<presence xmlns="jabber:client" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com/tmschat.test" to="tmschat.test@gmail.com/agsXMPP24F657E5"><user:x xmlns:user="http://jabber.org/protocol/muc#user"><user:item role="moderator" affiliation="owner" jid="tmschat.test@gmail.com/agsXMPP24F657E5" /><user:status code="100" /><user:status code="110" /></user:x><x xmlns="http://jabber.org/protocol/muc" /><x xmlns="vcard-temp:x:update" /><nick xmlns="http://jabber.org/protocol/nick">tms paxcel</nick></presence>
<presence xmlns="jabber:client" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com/tmschat.test" to="tmschat.test@gmail.com/agsXMPP24F657E5"><x xmlns="http://jabber.org/protocol/muc" /><x xmlns="vcard-temp:x:update" /><nick xmlns="http://jabber.org/protocol/nick">tms paxcel</nick><user:x xmlns:user="http://jabber.org/protocol/muc#user"><user:item role="moderator" affiliation="owner" jid="tmschat.test@gmail.com/agsXMPP24F657E5" /><user:status code="110" /></user:x></presence>
<presence xmlns="jabber:client" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com/cd3bd3ffd02e7d7c" to="tmschat.test@gmail.com/agsXMPP24F657E5"><user:x xmlns:user="http://jabber.org/protocol/muc#user"><user:item role="participant" affiliation="member" jid="sbangotra@gmail.com/gmail.59477926" /></user:x><status>Working. DND!</status><x xmlns="http://jabber.org/protocol/muc#user" /><nick:nick xmlns:nick="http://jabber.org/protocol/nick">Sourav Bangotra</nick:nick><show>dnd</show><x xmlns="vcard-temp:x:update"><photo>a8bb03071cb085b5705d49b43f32f7b7cb9c9a6c</photo></x></presence>
<message xmlns="jabber:client" to="tmschat.test@gmail.com/agsXMPP24F657E5" type="groupchat" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com"><body><user:x xmlns:user="http://jabber.org/protocol/muc#user"><user:item jid="sbangotra@gmail.com/gmail.59477926" status="available" nick="cd3bd3ffd02e7d7c" /></user:x></body><nos:x xmlns:nos="google:nosave" value="disabled" /><arc:record xmlns:arc="http://jabber.org/protocol/archive" otr="false" /></message>
<presence xmlns="jabber:client" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com/cd3bd3ffd02e7d7c" to="tmschat.test@gmail.com/agsXMPP24F657E5"><status>Working. DND!</status><nick:nick xmlns:nick="http://jabber.org/protocol/nick">Sourav Bangotra</nick:nick><show>dnd</show><x xmlns="vcard-temp:x:update"><photo>a8bb03071cb085b5705d49b43f32f7b7cb9c9a6c</photo></x><x xmlns="http://jabber.org/protocol/muc#user"><item role="participant" affiliation="member" jid="sbangotra@gmail.com/gmail.59477926" /></x></presence>
<message type="groupchat" to="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com"><body>hello!</body></message>
<message xmlns="jabber:client" to="tmschat.test@gmail.com/agsXMPP24F657E5" type="groupchat" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com/tmschat.test"><body>hello!</body><nos:x xmlns:nos="google:nosave" value="disabled" /><arc:record xmlns:arc="http://jabber.org/protocol/archive" otr="false" /></message>
<message xmlns="jabber:client" to="tmschat.test@gmail.com/agsXMPP24F657E5" id="C0121D3DF6146044_0" iconset="classic" type="groupchat" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com/cd3bd3ffd02e7d7c"><body>Hi, there!</body><met:google-mail-signature xmlns:met="google:metadata">g48rHhpcoSqMxbjLbxy-gNmTVGI</met:google-mail-signature><cha:active xmlns:cha="http://jabber.org/protocol/chatstates" /><nos:x xmlns:nos="google:nosave" value="disabled" /><arc:record xmlns:arc="http://jabber.org/protocol/archive" otr="false" /></message>
<presence xmlns="jabber:client" from="pallavi.vasishta40@gmail.com/Talk.v104FD01B92B" to="tmschat.test@gmail.com"><status /><priority>24</priority><c xmlns="http://jabber.org/protocol/caps" node="http://www.google.com/xmpp/client/caps" ver="1.0.0.104" ext="share-v1 voice-v1" /><x xmlns="jabber:x:delay" stamp="20120521T12:15:28" /><x xmlns="vcard-temp:x:update"><photo>43be36c24047d10e5fe968d38bd048a146af2740</photo></x></presence>
<presence xmlns="jabber:client" from="pallavi.vasishta40@gmail.com/Talk.v104FD01B92B" to="tmschat.test@gmail.com"><status /><priority>24</priority><c xmlns="http://jabber.org/protocol/caps" node="http://www.google.com/xmpp/client/caps" ver="1.0.0.104" ext="voice-v1" /><x xmlns="jabber:x:delay" stamp="20120521T12:15:29" /><x xmlns="vcard-temp:x:update"><photo>43be36c24047d10e5fe968d38bd048a146af2740</photo></x></presence>
<presence xmlns="jabber:client" from="pallavi.vasishta40@gmail.com/Talk.v104FD01B92B" to="tmschat.test@gmail.com"><status /><priority>24</priority><c xmlns="http://jabber.org/protocol/caps" node="http://www.google.com/xmpp/client/caps" ver="1.0.0.104" ext="voice-v1" /><x xmlns="jabber:x:delay" stamp="20120521T12:15:29" /><x xmlns="vcard-temp:x:update"><photo>43be36c24047d10e5fe968d38bd048a146af2740</photo></x></presence>
<presence xmlns="jabber:client" from="pallavi.vasishta40@gmail.com/Talk.v104FD01B92B" to="tmschat.test@gmail.com"><status /><priority>24</priority><c xmlns="http://jabber.org/protocol/caps" node="http://www.google.com/xmpp/client/caps" ver="1.0.0.104" ext="share-v1 voice-v1" /><x xmlns="jabber:x:delay" stamp="20120521T12:15:29" /><x xmlns="vcard-temp:x:update"><photo>43be36c24047d10e5fe968d38bd048a146af2740</photo></x></presence>
<presence xmlns="jabber:client" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com/cd3bd3ffd02e7d7c" to="tmschat.test@gmail.com/agsXMPP24F657E5"><status>Working. DND!</status><nick:nick xmlns:nick="http://jabber.org/protocol/nick">Sourav Bangotra</nick:nick><show>dnd</show><x xmlns="vcard-temp:x:update"><photo>a8bb03071cb085b5705d49b43f32f7b7cb9c9a6c</photo></x><x xmlns="http://jabber.org/protocol/muc#user"><item role="participant" affiliation="member" jid="sbangotra@gmail.com/gmail.59477926" /></x></presence>
<iq id="agsXMPP_4" type="set" to="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com"><query xmlns="http://jabber.org/protocol/muc#owner"><destroy><reason /></destroy></query></iq>
<iq xmlns="jabber:client" to="tmschat.test@gmail.com/agsXMPP24F657E5" id="agsXMPP_4" type="result" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com" />
</stream:stream>
This post was edited on 2013-03-17, 14:52 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you get the following presence packets from the Gtalk group chat server:

  1. <presence xmlns="jabber:client" from="private-chat-32fe72ae-497e-41c8-b9d6-4d6dc9b45e6f@groupchat.google.com/cd3bd3ffd02e7d7c" to="tmschat.test@gmail.com/agsXMPP24F657E5">
  2.     <user:x xmlns:user="http://jabber.org/protocol/muc#user">
  3.         <user:item role="participant" affiliation="member" jid="sbangotra@gmail.com/gmail.59477926" />
  4.     </user:x>
  5.     <status>Working. DND!</status>
  6.     <x xmlns="http://jabber.org/protocol/muc#user" />
  7.     <nick:nick xmlns:nick="http://jabber.org/protocol/nick">Sourav Bangotra</nick:nick><show>dnd</show>
  8.     <x xmlns="vcard-temp:x:update">
  9.         <photo>a8bb03071cb085b5705d49b43f32f7b7cb9c9a6c</photo>
  10.     </x>
  11. </presence>

As you can see this packet includes the nickname for the id cd3bd3ffd02e7d7c

  1. <nick:nick xmlns:nick="http://jabber.org/protocol/nick">Sourav Bangotra</nick:nick>

You can create a ID => nickname mapping from these presence packets.
Avatar
Sourav #5
Member since May 2012 · 12 posts
Group memberships: Members
Show profile · Link to this post
Thank you, Alex, for making life easier! :)
Avatar
Alex #6
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
no problem, this applies only to GTalk. They don't follow the standard here exactly.
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