public void NewMessage(string msgMarkup) { ChatUser chatClient = DBSupport.GetUser(new ChatUser { ConnectionId = Context.ConnectionId }); string[] exceptUsers = null; if (chatClient == null) { string username = Context.RequestCookies["FunkyUser"].Value.Substring(0, Context.RequestCookies["FunkyUser"].Value.IndexOf('&')); username = username.Substring(username.IndexOf('=') + 1); chatClient = DBSupport.GetUser(new ChatUser { Username = username }); exceptUsers = SharedSupport.ExceptUsers(chatClient); exceptUsers = exceptUsers.Concat(new string[] { Context.ConnectionId }).ToArray(); exceptUsers = exceptUsers.ToList().Where(x => !x.Equals(chatClient.ConnectionId)).ToArray(); } else { exceptUsers = SharedSupport.ExceptUsers(chatClient); } //For updating context user connect time DBSupport.UpdateUser(chatClient); Clients.AllExcept(exceptUsers).newUserMessage(msgMarkup); }