webXMPP

Check-in [2179aad7b2]
Login

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

Overview
Comment:Add some support for Chromium with nullified functions (for Chromium engine on Ubuntu Touch)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:2179aad7b2cc9752d665c7247269cd64bff5225928f4654379855c30e222d265
User & Date: ajv-899-334-8894@vsta.org 2017-07-25 01:58:52
Context
2017-07-25
04:21
Add an explicit button to re-sync with server, when you're not sure (and it saves the full cost of a screen repaint). check-in: 7f4bafda00 user: ajv-899-334-8894@vsta.org tags: master, trunk
01:58
Add some support for Chromium with nullified functions (for Chromium engine on Ubuntu Touch) check-in: 2179aad7b2 user: ajv-899-334-8894@vsta.org tags: master, trunk
2017-07-01
00:03
Merge branch 'master' of https://github.com/vandys/webXMPP check-in: bbd719910e user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to js/fcm.js.

40
41
42
43
44
45
46





47
48
49
50
51
52
53
}

// UI exposure
let bg = false;

// For Chrome, when we lose focus we'll have to use their push API
function visChange(ev) {





    const vs =  document.visibilityState;

    console.log("visChange", vs, bg);
    if (vs == "hidden") {
	if (!bg) {
	    bg = true;
	    // Abort long polling since Chrome will stop running soon







>
>
>
>
>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
}

// UI exposure
let bg = false;

// For Chrome, when we lose focus we'll have to use their push API
function visChange(ev) {
    if ((myToken == null) || (myToken == "null")) {
	// Ubuntu Touch, our Chromium build doesn't do FCM, but we
	//  have a notification daemon of our own.
	return;
    }
    const vs =  document.visibilityState;

    console.log("visChange", vs, bg);
    if (vs == "hidden") {
	if (!bg) {
	    bg = true;
	    // Abort long polling since Chrome will stop running soon

Changes to put.py.

17
18
19
20
21
22
23








24
25
26
27
28
29
30
	# /user
	if not self.path_match("user"):
	    return False,None

	# Client ID
	clientID = self.vals.get("clientID", "XXX")









	# Focus
	approot = self.server.approot
	u = approot.users.get(self.user)
	if u is None:
	    return False,None
	if "bg" in self.vals:
	    # Note hostname at which they reached us







>
>
>
>
>
>
>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
	# /user
	if not self.path_match("user"):
	    return False,None

	# Client ID
	clientID = self.vals.get("clientID", "XXX")

	# Deflect bogus values
	if "bg" in self.vals:
	    if self.vals["bg"] == "null":
		return True,self.send_result("", "text/html")
	if "fg" in self.vals:
	    if self.vals["fg"] == "null":
		return True,self.send_result("", "text/html")

	# Focus
	approot = self.server.approot
	u = approot.users.get(self.user)
	if u is None:
	    return False,None
	if "bg" in self.vals:
	    # Note hostname at which they reached us