Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Google Talk working fine, but GMail acting strange.
RasmusKL #1
Member since Dec 2006 · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: Strange GTalk Behaviour...

So I got google talk working, all great. I can send messages to GTalk and it works fine. I get presence from both GTalk and GMail, all is fine and dandy. I made a small program that just shows the messages it recieves and then replies 'Hello.' if it recieves the string 'hey'... This works fine for GTalk. However, if I try to send messages from GMail Chat, they are recieved fine by my program... And if I send 'hey', the following happens:

<message xmlns="jabber:client" from="" to="" type="chat" id="1F2B1C8FFAC2BA6B1"><body>hey</body><met:google-mail-signature xmlns:met="google:metadata">4e843b167454257d</met:google-mail-signature><cha:active xmlns:cha="" /><nos:x xmlns:nos="google:nosave" value="disabled" /><arc:record xmlns:arc="" otr="false" /></message>

Message ( hey

<message xmlns="jabber:client" to=""><body>Hello.</body></message>

<message xmlns="jabber:client" from="" to="!0A5EE537" type="error"><body>Hello.</body><nos:x xmlns:nos="google:nosave" value="disabled" /><arc:record xmlns:arc="" otr="false" /><error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></message>

Message ( Hello.

The message just bounces and comes back, as if GMail Chat sent me the same message? Also, it doesn't arrive at the GMail Chat... It seems rather strange :-)

I don't really think it's a problem in the library, however I thought some of you might have seen the problem before, and know how to work around it ... ?

My code for replying to the message is really simple:

        void xmpp_OnMessage(object sender, agsXMPP.protocol.client.Message msg)
            WriteLine("Message ("+msg.From.ToString()+"): " + msg.Body);
            if (msg.Body == "hey")
                SendMessage(msg.From, "Hello.");

        void SendMessage(Jid to, string body)
            xmpp.Send(new agsXMPP.protocol.client.Message(to, body));

 - Rasmus.
Alex #2
Member since Feb 2003 · 4433 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
the message which you are sending has no type attribute. Can you try to add a type of chat?

  1. void SendMessage(Jid to, string body)
  2. {
  3.     agsXMPP.protocol.client.Message msg = new agsXMPP.protocol.client.Message(to, body)
  4.     msg.Type =;
  5.     xmpp.Send(msg);
  6. }

RasmusKL #3
Member since Dec 2006 · 8 posts
Group memberships: Members
Show profile · Link to this post
Awesome, it fixed my problem :-)


Really appreciate the feedback here.
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