public IHttpActionResult StopTyping(int id)
        {
            var conversation = ConversationService.Get(id);

            // push typing event to other conversation members
            PushService.PushToUsers("typing-stopped.weavy", new { Conversation = id, User = WeavyContext.Current.User, Name = WeavyContext.Current.User.Profile.Name ?? WeavyContext.Current.User.Username }, conversation.MemberIds.Where(x => x != WeavyContext.Current.User.Id));
            return(Ok(conversation));
        }
Пример #2
0
        public async Task <HttpStatusCodeResult> Typing(int id)
        {
            var conversation = ConversationService.Get(id);
            // push typing event to other conversation members
            await PushService.PushToUsers(PushService.EVENT_TYPING, new TypingModel { Conversation = id, User = WeavyContext.Current.User }, conversation.MemberIds.Where(x => x != WeavyContext.Current.User.Id));

            return(new HttpStatusCodeResult(HttpStatusCode.OK));
        }
Пример #3
0
 public IHttpActionResult StartTyping(int id)
 {
     if (ConfigurationService.Typing)
     {
         // push typing event to other conversation members
         var conversation = GetConversation(id);
         PushService.PushToUsers(PushService.EVENT_TYPING, new { Conversation = id, User = WeavyContext.Current.User, Name = WeavyContext.Current.User.Profile.Name ?? WeavyContext.Current.User.Username }, conversation.MemberIds.Where(x => x != WeavyContext.Current.User.Id));
         return(Ok(conversation));
     }
     return(BadRequest());
 }
Пример #4
0
 public HttpStatusCodeResult Typing(int id)
 {
     if (ConfigurationService.Typing)
     {
         // push typing event to other conversation members
         var conversation = ConversationService.Get(id);
         PushService.PushToUsers(PushService.EVENT_TYPING, new TypingModel {
             Conversation = id, User = WeavyContext.Current.User
         }, conversation.MemberIds.Where(x => x != WeavyContext.Current.User.Id));
         return(new HttpStatusCodeResult(HttpStatusCode.OK));
     }
     return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
 }