本文整理汇总了C#中agsXMPP.protocol.client.Presence.SwitchDirection方法的典型用法代码示例。如果您正苦于以下问题:C# Presence.SwitchDirection方法的具体用法?C# Presence.SwitchDirection怎么用?C# Presence.SwitchDirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类agsXMPP.protocol.client.Presence
的用法示例。
在下文中一共展示了Presence.SwitchDirection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessRosterIQ
//.........这里部分代码省略.........
ri = new RosterItem();
ri.Name = userFriend.Nick;
ri.Jid = userFriend.JID;
ri.Subscription = userFriend.SubscriptionType;
newRosterIq.Query.AddRosterItem(ri);
bSend = Send(rosterItem.Jid, newRosterIq);
if (!bSend)
{
}
newPresence.Type = PresenceType.unsubscribed;
bSend = Send(rosterItem.Jid, newPresence);
if (!bSend)
{
}
newPresence = new Presence();
newPresence.From = rosterItem.Jid;
newPresence.To = this.m_ClientAccount.JID;
newPresence.Type = PresenceType.unavailable;
newPresence.Language = this.objClientlanguage.Name;
bSend = Send(newPresence.To, newPresence);
if (!bSend)
{
}
newPresence.SwitchDirection();
bSend = Send(newPresence.To, newPresence);
if (!bSend)
{
}
IQ result = new IQ(IqType.result);
result.Id = iq.Id;
result.From = this.m_ClientAccount.JID;
result.To = this.m_ClientAccount.JID;
Send(result);
newRosterIq = new RosterIq(IqType.set);
newRosterIq.Namespace = agsXMPP.Uri.CLIENT;
ri = new RosterItem();
ri.Name = rosterItem.Name;
ri.Jid = rosterItem.Jid;
ri.Subscription = rosterItem.Subscription;
newRosterIq.Query.AddRosterItem(ri);
Send(newRosterIq);
}
else if (userFriend.SubscriptionType == SubscriptionType.from)
{
contactAccount.RemoveFriend(userFriend);
contactAccount.Save();
示例2: ProcessPresence
//.........这里部分代码省略.........
{
newPresence = new Presence();
newPresence.From = new Jid(presence.To.Bare + "/" + user.Nick);
newPresence.To = login.JID;
newPresence.MucUser = new agsXMPP.protocol.x.muc.User();
newPresence.MucUser.Item = new agsXMPP.protocol.x.muc.Item(user.Affiliation, user.Role);
Send(newPresence.To, newPresence);
newPresence = new Presence();
newPresence.From = new Jid(presence.To.Bare + "/" + login.Nick); ;
newPresence.To = user.JID;
newPresence.MucUser = new agsXMPP.protocol.x.muc.User();
newPresence.MucUser.Item = new agsXMPP.protocol.x.muc.Item(login.Affiliation, login.Role);
Send(newPresence.To, newPresence);
}
item.Value.Enter(login);
}
}
return;
}
}
}
foreach (Friend friend in this.m_ClientAccount.Friends)
{
Account account = this.m_Server.AccountManager.FindAccount(friend.JID.ToString());
if (account == null)
{
continue;
}
if (!this.m_Server.ClientConnections.ContainsKey(account))
{
continue;
}
Presence newPresence = new Presence();
//newPresence.From = presence.From;
//newPresence.To = presence.To;
newPresence.Priority = presence.Priority;
SubscriptionType subscriptionType = friend.SubscriptionType;
if (subscriptionType == SubscriptionType.from)
{
newPresence.From = account.JID;
newPresence.To = this.m_ClientAccount.JID;
Send(newPresence);
}
else if (subscriptionType == SubscriptionType.to)
{
newPresence.From = this.m_ClientAccount.JID;
newPresence.To = account.JID;
Send(account, newPresence);
}
else if (subscriptionType == SubscriptionType.both)
{
newPresence.From = account.JID;
newPresence.To = this.m_ClientAccount.JID;
Send(newPresence);
newPresence.SwitchDirection();
//this.m_Server.ClientConnections[account].Send(newPresence);
Send(account, newPresence);
}
else
{
}
}
}
#endregion
#region else
else
{
}
#endregion
}
#endregion
this.m_Server.AccountManager.Save();
}