public async Task <PartialViewResult> GetAllConversationThreads(int take = 50)
        {
            ConversationsVM vm = new ConversationsVM
            {
                Threads = await CommunityLogic.GetMessageThreads(take, new List <Types.ConvThreadCategory> {
                    Types.ConvThreadCategory.MainDashboard,
                    Types.ConvThreadCategory.OfficialCoins, Types.ConvThreadCategory.FeatureRequests
                }, CurrentUser),
                CurrentUser       = CurrentUser,
                HideCreateNewPost = true
            };

            List <OfficialCoin> officialCoins = CryptoLogic.GetAllOfficialCoins();

            foreach (var x in vm.Threads.Where(x => x.OfficialCoinId > 0))
            {
                OfficialCoin officialCoin = officialCoins.FirstOrDefault(o => o.OfficialCoinId == x.OfficialCoinId);
                if (officialCoin == null)
                {
                    continue;
                }

                x.OfficialCoin = officialCoin;
                x.ShowOfficialCoinNameOnThread = true;
            }

            return(PartialView("_Conversations", vm));
        }
Exemple #2
0
        // GET: /Messages/StartConversation
        public ActionResult StartConversation()
        {
            ConversationsVM conversationsVM = new ConversationsVM();
            string          userID          = User.Identity.GetUserId();

            conversationsVM.Members = (from user in db.Users
                                       where user.Id != userID
                                       select user).OrderBy(item => item.Name).ToList();
            return(View(conversationsVM));
        }
        public async Task <PartialViewResult> GetThreadsWithComments(int threadId)
        {
            // Aka: View a single thread with comments.
            ConversationsVM vm = new ConversationsVM
            {
                CurrentThread       = await GetThreadWithComments(threadId),
                CurrentUser         = CurrentUser,
                IsCreateCommentMode = true
            };

            return(PartialView("_ThreadCommentsView", vm));
        }
        public async Task <PartialViewResult> GetConversationThreads(string threadName, Types.ConvThreadCategory category, int officialCoinId = 0, int take = 50)
        {
            ConversationsVM vm = new ConversationsVM
            {
                CurrentThread = new BBThread
                {
                    ThreadName   = threadName,
                    CategoryCode = category
                },
                Threads     = await GetThreadsByCategory(take, category, officialCoinId),
                CurrentUser = CurrentUser
            };

            return(PartialView("_Conversations", vm));
        }