protected void PostMessageHandler(object sender, System.EventArgs e) { int userID = SessionAdapter.GetUserID(); // store the new message in the given thread string mailTemplate = ApplicationAdapter.GetEmailTemplate(EmailTemplate.ThreadUpdatedNotification); int messageID = ThreadManager.CreateNewMessageInThread(_thread.ThreadID, userID, meMessageEditor.MessageText, meMessageEditor.MessageTextHTML, Request.UserHostAddress.ToString(), meMessageEditor.MessageTextXML, meMessageEditor.SubscribeToThread, mailTemplate, ApplicationAdapter.GetEmailData(), CacheManager.GetSystemData().SendReplyNotifications); // invalidate forum RSS in cache ApplicationAdapter.InvalidateCachedForumRSS(_thread.ForumID); // if auditing is required, we've to do this now. if (SessionAdapter.CheckIfNeedsAuditing(AuditActions.AuditNewMessage)) { SecurityManager.AuditNewMessage(userID, messageID); } // invalidate forum in asp.net cache CacheManager.InvalidateCachedItem(CacheManager.ProduceCacheKey(CacheKeys.SingleForum, _thread.ForumID)); // all ok, redirect to message list int startAtMessageIndex = ThreadGuiHelper.GetStartAtMessageForGivenMessageAndThread(_thread.ThreadID, messageID, SessionAdapter.GetUserDefaultNumberOfMessagesPerPage()); if (meMessageEditor.AddAttachment) { // redirect to manage attachment form for this message Response.Redirect(string.Format("Attachments.aspx?SourceType=1&MessageID={0}", messageID), true); } else { Response.Redirect(string.Format("Messages.aspx?ThreadID={0}&StartAtMessage={1}&#{2}", _thread.ThreadID, startAtMessageIndex, messageID), true); } }
protected void PostMessageHandler(object sender, System.EventArgs e) { int userID = SessionAdapter.GetUserID(); int messageID = 0; // store the new message as a new thread in the current forum. bool isSticky = meMessageEditor.IsSticky; if (!_userCanCreateNormalThreads && _userCanCreateStickyThreads) { // always sticky isSticky = true; } int threadID = ForumManager.CreateNewThreadInForum(_forum.ForumID, userID, meMessageEditor.NewThreadSubject, meMessageEditor.MessageText, meMessageEditor.MessageTextHTML, isSticky, Request.UserHostAddress.ToString(), _forum.DefaultSupportQueueID, meMessageEditor.SubscribeToThread, out messageID); // invalidate forum RSS in cache ApplicationAdapter.InvalidateCachedForumRSS(_forum.ForumID); if (SessionAdapter.CheckIfNeedsAuditing(AuditActions.AuditNewThread)) { SecurityManager.AuditNewThread(userID, threadID); } // invalidate Forum in ASP.NET cache CacheManager.InvalidateCachedItem(CacheManager.ProduceCacheKey(CacheKeys.SingleForum, _forum.ForumID)); if (meMessageEditor.AddAttachment) { // go to attachment management. Response.Redirect(string.Format("Attachments.aspx?SourceType=2&MessageID={0}", messageID), true); } else { // all ok, redirect to thread list Response.Redirect("Threads.aspx?ForumID=" + _forum.ForumID, true); } }