Changeset d3efc818ad12f25b70157a80a98888a3fbaac544 for http/markread.cc
- Timestamp:
- 08/23/10 22:36:53 (21 months ago)
- Children:
- ec0da3f87768820f9ca9e8065c7998e9d825bd4c
- Parents:
- 22d9643ba8d951cde698749cf25dbe905e197a4f
- git-committer:
- Antti-Juhani Kaijanaho <antti-juhani@…> (08/23/10 22:36:53)
- Files:
-
- 1 modified
-
http/markread.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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 }
