public void OnPeerPresence(PeerUpdate peer) { ClientConfirmation(Confirmation.For(peer)); GetPeerList(new Message()); if (DateTimeOffset.UtcNow.Subtract(peer.SentDateTimeUtc).TotalSeconds < 10) { ToastNotificationService.ShowPresenceNotification( peer.PeerData.Name, AvatarLink.EmbeddedLinkFor(peer.PeerData.Avatar), peer.PeerData.IsOnline); } _foregroundChannel?.OnSignaledPeerDataUpdated(); }
public IAsyncAction OnPeerPresenceAsync(PeerUpdate peer) { return(Task.Run(async() => { await ClientConfirmationAsync(Confirmation.For(peer)); await GetPeerListAsync(new Message()); if (DateTimeOffset.UtcNow.Subtract(peer.SentDateTimeUtc).TotalSeconds < 10) { ToastNotificationService.ShowPresenceNotification( peer.PeerData.Name, AvatarLink.EmbeddedLinkFor(peer.PeerData.Avatar), peer.PeerData.IsOnline); } _foregroundChannel?.OnSignaledPeerDataUpdatedAsync(); }).AsAsyncAction()); }