Skip to content

Commit 3a29430

Browse files
committed
use webpush (workaround) standard
1 parent 95f0efb commit 3a29430

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/HelperFriend.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
import static com.zoffcc.applications.trifa.MainActivity.tox_friend_send_lossless_packet;
5555
import static com.zoffcc.applications.trifa.TRIFAGlobals.CONTROL_PROXY_MESSAGE_TYPE.CONTROL_PROXY_MESSAGE_TYPE_PUSH_URL_FOR_FRIEND;
5656
import static com.zoffcc.applications.trifa.TRIFAGlobals.GENERIC_TOR_USERAGENT;
57+
import static com.zoffcc.applications.trifa.TRIFAGlobals.GENERIC_UNIFIED_WEBPUSH_CONTENT_ENCODING;
58+
import static com.zoffcc.applications.trifa.TRIFAGlobals.GENERIC_UNIFIED_WEBPUSH_TTL_SECONDS;
5759
import static com.zoffcc.applications.trifa.TRIFAGlobals.LAST_ONLINE_TIMSTAMP_ONLINE_NOW;
5860
import static com.zoffcc.applications.trifa.TRIFAGlobals.ORBOT_PROXY_HOST;
5961
import static com.zoffcc.applications.trifa.TRIFAGlobals.ORBOT_PROXY_PORT;
@@ -1475,6 +1477,8 @@ static boolean friend_do_actual_weburl_call(final String friend_pubkey, final St
14751477
cacheControl(new CacheControl.Builder().noCache().build()).
14761478
url(pushurl_for_friend).
14771479
header("User-Agent", GENERIC_TOR_USERAGENT).
1480+
header("TTL", "" + GENERIC_UNIFIED_WEBPUSH_TTL_SECONDS).
1481+
header("Content-Encoding", GENERIC_UNIFIED_WEBPUSH_CONTENT_ENCODING).
14781482
post(formBody).
14791483
build();
14801484

android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/TRIFAGlobals.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ public class TRIFAGlobals
219219
static final int PUSH_URL_TRIGGER_GET_MESSAGE_FOR_delta_ms_prev = 100;
220220
static final int PUSH_URL_TRIGGER_GET_MESSAGE_FOR_delta_ms_after = 1000;
221221

222+
static final int GENERIC_UNIFIED_WEBPUSH_TTL_SECONDS = 5 * 60 * 60; // 5 hours in seconds
223+
static final String GENERIC_UNIFIED_WEBPUSH_CONTENT_ENCODING = "aes128gcm";
224+
222225

223226
static final String TOX_NODELIST_HOST = "nodes.tox.chat";
224227
static final String TOX_NODELIST_URL = "https://" + TOX_NODELIST_HOST + "/json";

0 commit comments

Comments
 (0)