Changeset d3efc81
- Timestamp:
- 08/23/10 22:36:53 (3 years ago)
- Branches:
- master
- Children:
- ec0da3f
- Parents:
- 22d9643
- git-author:
- Antti-Juhani Kaijanaho <antti-juhani@…> (08/23/10 22:36:53)
- git-committer:
- Antti-Juhani Kaijanaho <antti-juhani@…> (08/23/10 22:36:53)
- Location:
- http
- Files:
-
- 2 edited
-
article.cc (modified) (1 diff)
-
markread.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
http/article.cc
r563ece2 rd3efc81 95 95 boost::shared_ptr<db::user> u = req->get_user(); 96 96 97 if (is_single && u) u->mark_read(art->msgid()); 97 if (is_single && u && req->get_query_param("markread") != "no") 98 u->mark_read(art->msgid()); 98 99 99 100 db::thread_node::ptr tn = -
http/markread.cc
r22d9643 rd3efc81 41 41 (boost::shared_ptr<request> req, response::factory) 42 42 { 43 if (req->get_method() != "POST")44 {45 boost::shared_ptr<error_resource> er46 (new error_resource47 (cb, "405 Method not allowed"));48 er->add_header("Allow", "POST");49 throw resource_exception(er);50 }51 52 43 db::user::ptr u = req->get_user(); 53 44 … … 62 53 bool value = lookup(fd, "undo") != "yes"; 63 54 std::string msgid = lookup(fd, "msgid"); 64 std::string redir = lookup(fd, "redir"); 55 ::uri redir = lookup(fd, "redir"); 56 redir.replace_query_param("markread","no"); 65 57 66 if (value) 67 u->mark_read(msgid); 68 else 69 u->unmark_read(msgid); 70 58 if (req->get_method() == "POST") 59 { 60 if (value) 61 u->mark_read(msgid); 62 else 63 u->unmark_read(msgid); 64 } 71 65 boost::shared_ptr<redir_resource> r 72 (new redir_resource(cb, redir, "303 See other")); 66 (new redir_resource(cb, redir.to_string(), 67 "303 See other")); 73 68 throw resource_exception(r); 74 69 }
Note: See TracChangeset
for help on using the changeset viewer.
