我在https://www.blah.im上创建了两个帐户用于测试目的。我使用 agsXMPP 客户端库与服务器通信。连接是正确的,并且成员已登录。但不显示名册。
这是我的代码
xmpp.Open(userName, password);
xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
Console.WriteLine(xmpp.XmppConnectionState);
Console.WriteLine("Authenticated {0},", xmpp.Authenticated);
Console.WriteLine("Wait");
int i = 0;
do {
Console.Write(".");
i++;
if (i == 10)
_wait = false;
Thread.Sleep(3000);
} while (_wait);
Console.WriteLine("Connection state {0}", xmpp.XmppConnectionState);
Console.WriteLine("Authenticated {0},", xmpp.Authenticated);
agsXMPP.protocol.client.Presence p =
new agsXMPP.protocol.client.Presence
(ShowType.chat, "Online");
p.Type = PresenceType.available;
xmpp.Send(p);
xmpp.OnPresence += new agsXMPP.protocol.client.PresenceHandler(xmpp_OnPresence);
Thread.Sleep(3000);
Console.WriteLine("Who do you want to connect ");
string friend = Console.ReadLine();
Console.WriteLine("Start Chat");
static void xmpp_OnPresence(object sender, agsXMPP.protocol.client.Presence pres)
{
Console.WriteLine("Available Contacts: ");
Console.WriteLine("{0}@{1} {2}", pres.From.User, pres.From.Server, pres.Type);
Console.WriteLine();
}
是否有任何订阅内容必须完成才能获得可用成员?