public void SendToGroup(MessageInfo messageInfo) { ProcessFactory.GetDiscussionProcess().InsertMessage(Convert.ToInt32(messageInfo.ChannelName), messageInfo.UserId, messageInfo.Message); Clients.Group(messageInfo.ChannelName).receiveMessage(messageInfo.ChannelName, messageInfo.UserId, messageInfo.UserName, messageInfo.Message); Clients.Group(OWNER_GROUP_NAME).notifyOwners(messageInfo.ChannelName, messageInfo.UserId, messageInfo.UserName, messageInfo.Message); GroupsHelper.MarkUnReadForOfflineUsers(messageInfo.ChannelName); }
public void MarkUnRead() { if (!HasMarkedUnRead) { List <int> disconnectedUsers = Users.Except(ConnectedUsers).ToList(); ProcessFactory.GetDiscussionProcess().MarkUnread(IdeaId, disconnectedUsers); HasMarkedUnRead = true; } }
public void SendFile(FileInfo fileInfo) { int ideaId = Convert.ToInt32(fileInfo.ChannelName); ProcessFactory.GetDiscussionProcess().InsertFile(ideaId, fileInfo.UserId, fileInfo.FileId); FileDataObject file = ProcessFactory.GetFileProcess().FetchThumbnail(fileInfo.FileId, ideaId); Clients.Group(fileInfo.ChannelName).receiveFile(fileInfo.ChannelName, fileInfo.UserId, fileInfo.UserName, fileInfo.FileId, file.Name, file.ThumbnailBase64, file.ContentType, file.IsImage); Clients.Group(OWNER_GROUP_NAME).notifyOwners(fileInfo.ChannelName, fileInfo.UserId, fileInfo.UserName, null); GroupsHelper.MarkUnReadForOfflineUsers(fileInfo.ChannelName); }
public JsonResult FetchDiscussions(int ideaId, int page, int pagelength) { DiscussionInfo info = ProcessFactory.GetDiscussionProcess().GetDiscussion(ideaId, page, pagelength); return(Json(info)); }