An alternative to UBB.threads
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
FLocal/FLocal.IISHandler/handlers/request/MarkThreadAsReadHandler.cs

32 lines
1.0 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using FLocal.Common.dataobjects;
using FLocal.Migration.Gateway;
using System.Text.RegularExpressions;
using Web.Core;
using FLocal.Common;
using FLocal.Common.actions;
using System.Web;
namespace FLocal.IISHandler.handlers.request {
class MarkThreadAsReadHandler : ReturnPostHandler {
protected override void _Do(WebContext context) {
string[] requestParts = context.httprequest.Path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
Account account = context.session.account;
Thread thread = Thread.LoadById(int.Parse(requestParts[2]));
if(!requestParts[3].StartsWith("p")) throw new WrongUrlException(); //throw new CriticalException("wrong url");
Post post = Post.LoadById(int.Parse(requestParts[3].PHPSubstring(1)));
//if(post.thread.id != thread.id) throw new CriticalException("id mismatch");
thread.forceMarkAsRead(account, post);
}
}
}