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;
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?
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);
}
{
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?