Skip to content

Commit

Permalink
proxy server: use isMember for timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
aberaud committed Sep 27, 2023
1 parent 3191498 commit 601758f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dht_proxy_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@ DhtProxyServer::sendPushNotification(const std::string& token, Json::Value&& jso
request->set_body(Json::writeString(jsonBuilder_, std::move(json)));
} else {
// NOTE: see https://github.com/appleboy/gorush
auto isResubscribe = json.isMember("timeout");
Json::Value notification(Json::objectValue);
Json::Value tokens(Json::arrayValue);
tokens[0] = token;
Expand All @@ -1095,7 +1096,6 @@ DhtProxyServer::sendPushNotification(const std::string& token, Json::Value&& jso
notification["expiration"] = exp;
if (!topic.empty())
notification["topic"] = topic;
auto isResubscribe = !notification["data"]["timeout"].isNull();
if (highPriority || isResubscribe) {
Json::Value alert(Json::objectValue);
alert["title"]="hello";
Expand Down

0 comments on commit 601758f

Please sign in to comment.