예제 #1
0
 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();
 }
예제 #2
0
 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());
 }