webXMPP

Check-in [289d95fd34]
Login

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

Overview
Comment:Don't post notification when it's a mirror of a message we generated ourselves on another client instance.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:289d95fd343718a1bd6850d8951c0f8d9f8acc1fd0c0e941e427c8935915dca3
User & Date: web 2019-05-05 02:39:32
Context
2019-05-05
03:11
Play "battlin' LED's" with the system, and always do a full setup on the LED's before setting them blinking. Finish logic to recognize our own typing on another device, and don't make noise or blink an LED for it. check-in: f95204b778 user: vandys tags: master, trunk
02:39
Don't post notification when it's a mirror of a message we generated ourselves on another client instance. check-in: 289d95fd34 user: web tags: master, trunk
2019-04-28
18:47
Add MMS support check-in: df0f18ff49 user: web tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to js/ui.js.

346
347
348
349
350
351
352

353
354






355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375


376
377
378
379
380
381
382
    }

    // Response message
    //  gen - Version number for next request
    //  msgs[] - List of messages, each added to ourMsgs[]
    reqGen = resp.gen;
    var msg = null;

    for (var i = 0; i < resp.msgs.length; ++i) {
	msg = resp.msgs[i];







	// Too full, drop first
	if (ourMsgs.length == ourConfig.nmsg) {
	    ourMsgs.shift();
	}
	ourMsgs.push(msg);
    }

    // Repaint the "ourText" pane
    paint();

    // Post a Notification?
    if (document.hidden) {
	if (ourState != 3) {
	    notify(msg.body + " - " + msg.them);
	    ourState = 3;
	}
	return;
    }

    // Not hidden, looking at screen


    moreMessages();
}

// Deal with an error while asking for messages
function rxerror() {
    // Already cancelled
    if (curReq == null) {







>


>
>
>
>
>
>












|








>
>







346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
    }

    // Response message
    //  gen - Version number for next request
    //  msgs[] - List of messages, each added to ourMsgs[]
    reqGen = resp.gen;
    var msg = null;
    let anyRX = false;
    for (var i = 0; i < resp.msgs.length; ++i) {
	msg = resp.msgs[i];

	// Note any sent *to* us (as opposed to us typing
	//  one, possibly on another client)
	if (msg.rx) {
	    anyRX = true;
	}

	// Too full, drop first
	if (ourMsgs.length == ourConfig.nmsg) {
	    ourMsgs.shift();
	}
	ourMsgs.push(msg);
    }

    // Repaint the "ourText" pane
    paint();

    // Post a Notification?
    if (anyRX && document.hidden) {
	if (ourState != 3) {
	    notify(msg.body + " - " + msg.them);
	    ourState = 3;
	}
	return;
    }

    // Not hidden, looking at screen
    // (Or it was our typing, so keep waiting for something
    //  noteworthy.)
    moreMessages();
}

// Deal with an error while asking for messages
function rxerror() {
    // Already cancelled
    if (curReq == null) {