没代码我说个J8:
public void Presence(User.EStatus status)
{
string statustxt = ""; //说明文字。比如,离开的原因:外出吃饭
string show = ""; //真正起作用的命令。
switch (status)
{
case User.EStatus.OnLine:
show = null;
break;
case User.EStatus.Chat:
show = "chat";
break;
case User.EStatus.Busy:
show = "dnd";
break;
case User.EStatus.Leave:
show = "away";
break;
default:
show = null;
break;
}
jc.Presence(PresenceType.available, statustxt, show, jc.Priority);
}
具体的命令和说明,可以参照XMPP:
http://wiki.jabbercn.org/RFC6121#.E5.87.BA.E5.B8.AD.E4.BF.A1.E6.81.AF.E8.AF.AD.E6.B3.95