Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
lurscher #1
Member since Apr 2012 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: nimbuzz agsXMPP client can send invisible message, but sometimes does not work
I'm trying to reproduce the ability of nimbuzz client to change from visible to invisible

i've debug the message the nimbuzz client sends when changing to invisible and its basically able to obtain the same XMPP message by doing this..

using agsXMPP.Xml.Dom;

namespace XmppAccountProxy
{
    public class NimbuzzGhost : Element
    {
        public NimbuzzGhost()
        {
            this.TagName = "x";
            this.Namespace = "nimbuzz:ghost";
            this.Value = "65535";
        }
    }
}

...

public void changePresenceToInvisible(NimbuzzChatProxy sender)
        {
            Presence presence = new Presence();
            presence.Type = PresenceType.invisible;
            presence.From = sourceJid;
            presence.To = targetJid;
            presence.AddChild(new NimbuzzGhost());
            sender.xmpp.Send(presence);
        }

the packet is the same. In captured this packet by having contacts between accounts like A <-> B <-> C. B is actually agsXMPP while A and C are nimbuzz pc clients. so from client C, i change to invisible, and when handling the OnPresence event on the B client from C, i receive the packet above (with the nimbuzz ghost namespace), and forward it to A. The result is that from the A client, now B seems to have become invisible.

Interestingly enough, i cannot just send the 'changePresenceToInvisible' anytime, because sending the crafted message does not have any effect. I tried to handle the readXml to see if there was any other context that might be affecting the effectivity of the message but to no avail.

Any ideas what i might be missing?
This post was edited on 2012-04-04, 22:43 by lurscher.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by lurscher:
Any ideas what i might be missing?

yes. You did not capture the outgoing packets which the Nimbuzz client sends when you go in invisible mode.
Presence is a 1=>n pattern. You send 1 packet to the server and the server sends out n packets to your contacts. And teh server may modify the packet before it gets distributed.

I assume that there is a special "mark me as invisible" packet which the clients sends to the server.

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