proxy server: respect value priority for push notifications

This commit is contained in:
Adrien Béraud committed 2019-12-14 13:02:07 -05:00
1 parent 374fdd6cc9
commit 1f672773ba
1 file changed
+4 -1
+4 -1
View File
@@ -706,7 +706,10 @@ DhtProxyServer::subscribe(restinio::request_handle_t request,
}
json["exp"] = ss.str();
}
sendPushNotification(pushToken, std::move(json), isAndroid, !expired);
auto maxPrio = 1000u;
for (const auto& v : values)
maxPrio = std::min(maxPrio, v->priority);
sendPushNotification(pushToken, std::move(json), isAndroid, !expired and maxPrio == 0);
return true;
}
);