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

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:


READ:
<message xmlns="jabber:client" from="rasmuskl@gmail.com/gmail.5089F224" to="rklhome@gmail.com" type="chat" id="1F2B1C8FFAC2BA6B1"><body>hey</body><met:google-mail-signature xmlns:met="google:metadata">4e843b167454257d</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>

Message (rasmuskl@gmail.com/gmail.5089F224): hey

WRITE:
<message xmlns="jabber:client" to="rasmuskl@gmail.com/gmail.5089F224"><body>Hello.</body></message>

READ:
<message xmlns="jabber:client" from="rasmuskl@gmail.com/gmail.5089F224" to="rklhome@gmail.com/GRAP!0A5EE537" type="error"><body>Hello.</body><nos:x xmlns:nos="google:nosave" value="disabled" /><arc:record xmlns:arc="http://jabber.org/protocol/archive" 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 (rasmuskl@gmail.com/gmail.5089F224): 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));
        }


Thanks,
 - Rasmus.
Avatar
Alex #2
Member since Feb 2003 · 4245 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 = MessageType.chat;
  5.     xmpp.Send(msg);
  6. }

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

Thanks.

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 SDK Support RSS