private void ChatManager_StatusUpdated(object sender, StatusUpdatedEventArgs e) { Dispatcher.Invoke(() => { switch (e.PresenceType) { case PresenceType.available: if (e.Status.GameStatus == ChatStatus.outOfGame) { if (!string.IsNullOrWhiteSpace(e.Status.Message)) CurrentStatus.Content = e.Status.Message; else if (e.Show == ShowType.chat) CurrentStatus.Content = "Online"; else CurrentStatus.Content = "Away"; } else CurrentStatus.Content = e.Status.GameStatus.Value; switch (e.Show) { case ShowType.away: CurrentStatus.Foreground = App.AwayBrush; break; case ShowType.chat: CurrentStatus.Foreground = App.ChatBrush; break; case ShowType.dnd: CurrentStatus.Foreground = App.BusyBrush; break; } break; case PresenceType.invisible: CurrentStatus.Content = "Invisible"; CurrentStatus.Foreground = App.ForeBrush; break; } }); }
public void SendPresence() { var status = new LeagueStatus(StatusMessage, Status); ShowType computed; if (DndStatuses.Contains(Status)) { computed = ShowType.dnd; } else if (ChatMode == ChatMode.Away) { computed = ShowType.away; } else { computed = ShowType.chat; } var args = new StatusUpdatedEventArgs(status, ChatMode == ChatMode.Invisible ? PresenceType.invisible : PresenceType.available, computed); StatusUpdated?.Invoke(this, args); if (!connected) { return; } xmpp.Send(new Presence(computed, status.ToXML(), 100) { Type = args.PresenceType }); }
public void SendPresence() { var status = new LeagueStatus(StatusMessage, Status); ShowType computed; if (DndStatuses.Contains(Status)) computed = ShowType.dnd; else if (ChatMode == ChatMode.Away) computed = ShowType.away; else computed = ShowType.chat; var args = new StatusUpdatedEventArgs(status, ChatMode == ChatMode.Invisible ? PresenceType.invisible : PresenceType.available, computed); StatusUpdated?.Invoke(this, args); if (!connected) return; xmpp.Send(new Presence(computed, status.ToXML(), 100) { Type = args.PresenceType }); }