public async Task SenderAction(Friend friend, NonMessageAction action) { string senderAction = ""; switch (action) { case NonMessageAction.MarkSeen: senderAction = "mark_seen"; break; case NonMessageAction.TypingOff: senderAction = "typing_off"; friend.Speaking.EndTypingToHome(); break; case NonMessageAction.TypingOn: senderAction = "typing_on"; friend.Speaking.BeginTypingToHome(); break; } if (friend.IsFacebook) { var contents = new { Recipient = new { Id = friend.Memory.Persistent.FacebookId }, Sender_action = senderAction }; await PostJsonMessage(contents); } }
public async Task SenderAction(Friend friend, NonMessageAction action) { if (action == NonMessageAction.TypingOn) { await PostJsonMessage("sendChatAction", new { ChatId = friend.Memory.Persistent.TelegramId, Action = "typing" }); } }
public Task SenderAction(Friend friend, NonMessageAction action) { switch (action) { case NonMessageAction.TypingOff: friend.Speaking.EndTypingToHome(); break; case NonMessageAction.TypingOn: friend.Speaking.BeginTypingToHome(); break; } return(Task.FromResult(0)); }
public async Task SenderAction(Friend friend, NonMessageAction action) { await friend.Endpoints.ForEachAsync(ep => ep.SenderAction(friend, action)); }