diff --git a/changelog b/changelog index aa0e9673336..d47247262af 100644 --- a/changelog +++ b/changelog @@ -37,6 +37,7 @@ SVN trunk: * Support filtering on campaign_list requests * filter by name * filter by last update time (before or after) + * filter by language of translation * campaign_list response now contains the time the request was processed * campaign_list response now contains information about translations * utils: added weblist.pl and webtgz.pl web interface programs diff --git a/src/campaign_server/campaign_server.cpp b/src/campaign_server/campaign_server.cpp index 4f2e727f246..213bb4b2798 100644 --- a/src/campaign_server/campaign_server.cpp +++ b/src/campaign_server/campaign_server.cpp @@ -139,6 +139,18 @@ void campaign_server::run() if((const t_string)(*req)["name"] != "" && (*req)["name"] != (**i)["name"]) continue; if(before_flag && ((const t_string)(**i)["timestamp"] == "" || lexical_cast_default((**i)["timestamp"],0) >= before)) continue; if(after_flag && ((const t_string)(**i)["timestamp"] == "" || lexical_cast_default((**i)["timestamp"],0) <= after)) continue; + int found = 1; + if((const t_string)(*req)["language"] != "") { + found = 0; + config::child_list translation = (**i).get_children("translation"); + for(config::child_list::iterator j = translation.begin(); j != translation.end(); ++j) { + if((*req)["language"] == (**j)["language"]) { + found = 1; + break; + } + } + } + if(found == 0) continue; campaign_list.add_child("campaign", (**i)); } cmps = campaign_list.get_children("campaign");