public PresenceEventArgs(string userName, string show, string type) { this.UserName = userName; this.ShowValue = (show ?? "").ToLower(); this.TypeValue = (type ?? "").ToLower(); if (!string.IsNullOrEmpty(this.TypeValue) && this.TypeValue == "unavailable") //* :unavailable (User has gone offline) { this.Presence = PresenceEnum.Offline; } else if (string.IsNullOrEmpty(this.ShowValue) || //* nil (Available, no <show/> element) this.ShowValue == "chat") //* :chat (Free for chat) { this.Presence = PresenceEnum.Available; } else if (this.ShowValue == "away") //* :away { this.Presence = PresenceEnum.Away; } else if (this.ShowValue == "dnd") //* :dnd (Do not disturb) { this.Presence = PresenceEnum.DoNotDisturb; } else if (this.ShowValue == "xa") //* :xa (Extended away) { this.Presence = PresenceEnum.ExtendedAway; } else { this.Presence = PresenceEnum.Offline; } }
public PresenceEventArgs(string userName, PresenceEnum presence) { this.UserName = userName; this.Presence = presence; }