diff --git a/dist/www-bootstrap/static/style-mobile.css b/dist/www-bootstrap/static/style-mobile.css index d7a6f6c..b48a6b4 100644 --- a/dist/www-bootstrap/static/style-mobile.css +++ b/dist/www-bootstrap/static/style-mobile.css @@ -142,6 +142,14 @@ background-color: #b2ffb0; } +.msg-summary-flag { + background-color: #ff9696; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} .msg-summary-seen { background-color: #eee; display: -webkit-box; @@ -227,6 +235,13 @@ } +.msg-view-header-flagged { + background-color: #ffc9c9; + border: 1px solid #9b1e1e; + padding: 5px; + margin-bottom: 10px; +} + .msg-view-header { background-color: #eee; border: 1px solid #666666; diff --git a/dist/www-bootstrap/static/style.css b/dist/www-bootstrap/static/style.css index 4cc679a..83c8e6f 100644 --- a/dist/www-bootstrap/static/style.css +++ b/dist/www-bootstrap/static/style.css @@ -239,6 +239,13 @@ margin-bottom: 10px; } +.msg-view-header-flagged { + background-color: #ffc9c9; + border: 1px solid #9b1e1e; + padding: 5px; + margin-bottom: 10px; +} + .msg-view-subject { font-size: xx-large; } diff --git a/src/www.c b/src/www.c index 4cbe0a2..99de903 100644 --- a/src/www.c +++ b/src/www.c @@ -699,6 +699,59 @@ int www_handler(void * cls, struct MHD_Connection * connection, const char * url whole_page = (char *)malloc(strlen(header) + strlen(page) + strlen(footer) + 1); sprintf(whole_page, "%s%s%s", header, page, footer); + } else if (strncasecmp(url, "/msgs/flag/", 11) == 0) { + con_inf->user = www_auth_ok(connection, url_); + + if (con_inf->user == NULL) { + www_401(header, footer, connection); + free(header); + free(footer); + return MHD_YES; + } + conference = -1; + area = -1; + msg = -1; + url_copy = strdup(&url[11]); + + aptr = strtok(url_copy, "/"); + if (aptr != NULL) { + conference = strtol(aptr, &endptr, 10); + if (endptr == aptr) { + conference = -1; + } + aptr = strtok(NULL, "/"); + if (aptr != NULL) { + area = strtol(aptr, &endptr, 10); + if (endptr == aptr) { + area = -1; + } + aptr = strtok(NULL, "/"); + if (aptr != NULL) { + msg = strtol(aptr, &endptr, 10); + if (endptr == aptr) { + msg = -1; + } + } + } + } + free(url_copy); + + if (conference != -1 && area != -1 && msg != -1) { + msgbase_flag_unflag(con_inf->user, conference, area, msg); + response = MHD_create_response_from_buffer (0, (void*) "", MHD_RESPMEM_PERSISTENT); + snprintf(buffer, PATH_MAX, "%smsgs/%d/%d/%d", conf.www_url, conference, area, msg); + + MHD_add_response_header (response, "Location", buffer); + MHD_queue_response (connection, MHD_HTTP_FOUND, response); + MHD_destroy_response(response); + free(header); + free(footer); + return MHD_YES; + } + www_404(header, footer, connection); + free(header); + free(footer); + return MHD_YES; } else if (strncasecmp(url, "/msgs/new/", 10) == 0) { con_inf->user = www_auth_ok(connection, url_); diff --git a/src/www_msgs.c b/src/www_msgs.c index 5b305a3..952f779 100644 --- a/src/www_msgs.c +++ b/src/www_msgs.c @@ -437,8 +437,11 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i strcat(page, buffer); len += strlen(buffer); - - sprintf(buffer, "