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 UpdatePresence(Presence p) { IsOffline = p.Status == null; if (!IsOffline) { Status = new LeagueStatus(p.Status, p.Show); if (Status.GameStatus == ChatStatus.inGame) { RiotServices.GameService.RetrieveInProgressSpectatorGameInfo(User.Name).ContinueWith(GotGameDTO); if (Cache != null) CurrentGameFetcher.FetchGame(Cache.Data.Summoner.SummonerId, GotGameInfo); } else { CurrentGameDTO = null; CurrentGameInfo = null; } Session.Current.SummonerCache.GetData(User.Name, GotSummoner); Session.Current.ChatManager.ForceUpdate(); } }
public void UpdatePresence(Presence p) { IsOffline = p.Status == null; if (!IsOffline) { Status = new LeagueStatus(p.Status, p.Show); if (Status.GameStatus == ChatStatus.inGame) { RiotServices.GameService.RetrieveInProgressSpectatorGameInfo(User.Name).ContinueWith(GotGameDTO); if (Cache != null) { CurrentGameFetcher.FetchGame(Cache.Data.Summoner.SummonerId, GotGameInfo); } } else { CurrentGameDTO = null; CurrentGameInfo = null; } Session.Current.SummonerCache.GetData(User.Name, GotSummoner); Session.Current.ChatManager.ForceUpdate(); } }
public StatusUpdatedEventArgs(LeagueStatus status, PresenceType presenceType, ShowType show) { Status = status; PresenceType = presenceType; Show = show; }
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 }); }