webXMPP

Check-in [4d5a71d733]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge branch 'master' of https://github.com/vandys/-webXMPP
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:4d5a71d7334a7ea30028ea0d637c08f2a46d3694cc20423d64fcc4af07cb06d4
User & Date: vandyswa@gmail.com 2017-06-30 00:27:46
Context
2017-06-30
05:09
Bring up, -ting subop handling for NAT accomodation check-in: ec8f5ea505 user: vandyswa@gmail.com tags: master, trunk
05:07
Bringup, UDP PONG protocol check-in: ffdf7a93ca user: ajv-899-334-8894@vsta.org tags: master, trunk
00:27
Merge branch 'master' of https://github.com/vandys/-webXMPP check-in: 4d5a71d733 user: vandyswa@gmail.com tags: master, trunk
00:26
Try to force high priority (doesn't win versus doze anyway). Extra logging; message-id in particular check-in: 3aead6a44a user: ajv-899-334-8894@vsta.org tags: master, trunk
2017-06-29
22:19
Bring up notified.py client on actual UBports phone check-in: a33e6791c5 user: vandyswa@gmail.com tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fcm.py.

18
19
20
21
22
23
24

25
26
27
28
29
30
31
..
34
35
36
37
38
39
40


	self.fcmkey = self.config.get("fcmkey")
    def fcm(self, host, iid_token, title, body):

	data = json.dumps(
	    {"notification": {
		 "title": title,
		 "body": body,

		 "click_action":
		     ("https://%s/html/xmpp_fcm.html" % (host,))
		},
	     "to": iid_token,
	    }
	)
	h = httplib.HTTPSConnection(FCMHOST)
................................................................................
	    "Content-Type": "application/json",
	}
	sys.stderr.write("POST FCM to %r\n" % (iid_token,))
	h.request("POST", FCMPATH, data, headers)
	r = h.getresponse()
	sys.stderr.write("%s FCM response %r reason %r\n" %
	    (time.asctime(), r.status, r.reason))









>







 







>
>
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
..
35
36
37
38
39
40
41
42
43
	self.fcmkey = self.config.get("fcmkey")
    def fcm(self, host, iid_token, title, body):

	data = json.dumps(
	    {"notification": {
		 "title": title,
		 "body": body,
		 "priority": "high",
		 "click_action":
		     ("https://%s/html/xmpp_fcm.html" % (host,))
		},
	     "to": iid_token,
	    }
	)
	h = httplib.HTTPSConnection(FCMHOST)
................................................................................
	    "Content-Type": "application/json",
	}
	sys.stderr.write("POST FCM to %r\n" % (iid_token,))
	h.request("POST", FCMPATH, data, headers)
	r = h.getresponse()
	sys.stderr.write("%s FCM response %r reason %r\n" %
	    (time.asctime(), r.status, r.reason))
	body = r.read()
	sys.stderr.write(" body: %r\n" % (body,))

Changes to js/ui.js.

82
83
84
85
86
87
88




89

90
91
92
93
94
95
96

// Returning online (network change, cell->wifi, etc.)
function goOnline() {
    if (curReq != null) {
	curReq.abort();
	curReq = null;
    }




    moreMessages();

}

// We've lost the network
function goOffline() {
    // Forget in-flight request
    if (curReq != null) {
	curReq.abort();







>
>
>
>
|
>







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101

// Returning online (network change, cell->wifi, etc.)
function goOnline() {
    if (curReq != null) {
	curReq.abort();
	curReq = null;
    }

    // If we don't already have a Notification up, we can go
    //  back to waiting for messages.
    if (ourState != 3) {
	moreMessages();
    }
}

// We've lost the network
function goOffline() {
    // Forget in-flight request
    if (curReq != null) {
	curReq.abort();