webXMPP

Check-in [f95204b778]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:f95204b7785a70a3980c571709fa0499c5d8022f5f9554e5dd6d5a157f6801f9
User & Date: vandys 2019-05-05 03:11:18
Context
2019-05-21
15:33
Support gif, too check-in: 85559f8e8c user: web tags: master, trunk
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/notified.py.

136
137
138
139
140
141
142

143
144
145
146
147
148
149
...
159
160
161
162
163
164
165

166

167
168
169
170
171
172
173
...
187
188
189
190
191
192
193

194
195
196
197
198
199
200





201
202
203
204
205
206
207
        leds = True
    except:
        pass

# Start/stop blinking
def blink():
    global blinking

    set_led("rgb_start", "1")
    blinking = True
def unblink():
    global blinking
    set_led("rgb_start", "0")
    blinking = False

................................................................................

# New notifications contained in this packet
def notify(pak):
    global gen, w, leds, blinking, is_locked

    inner = pak.inner
    w("Notification: gen %d -> %d\n" % (gen, inner["gen"]))

    for tup in inner["msgs"]:

        lt = len(tup)

        # Ignore mirrors of our own sends on other devices
        if lt and (not tup[0]):
            continue

        # No details at all, so just show one notification
................................................................................

        # Who plus headline plus body
        else:
            n1 = tup[1] + ": " + tup[2]
            n2 = tup[3]

        # Build actual notification

        n = notify2.Notification(n1, n2)
        log("Notification: " + n1 + ((", " + n2) if n2 else ""))
        try:
            n.show()
        except:
            traceback.format_exc()
            log("Notification not displayed")






    # Worry about the LEDs?
    if leds and (not blinking) and is_locked:
        blink()

    # Play sound
    os.system("paplay --volume=40000 %s" % (cfg.sound,))







>







 







>

>







 







>







>
>
>
>
>







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
...
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
        leds = True
    except:
        pass

# Start/stop blinking
def blink():
    global blinking
    setup_leds()
    set_led("rgb_start", "1")
    blinking = True
def unblink():
    global blinking
    set_led("rgb_start", "0")
    blinking = False

................................................................................

# New notifications contained in this packet
def notify(pak):
    global gen, w, leds, blinking, is_locked

    inner = pak.inner
    w("Notification: gen %d -> %d\n" % (gen, inner["gen"]))
    anyrx = False
    for tup in inner["msgs"]:
        w("  %s\n" % (tup,))
        lt = len(tup)

        # Ignore mirrors of our own sends on other devices
        if lt and (not tup[0]):
            continue

        # No details at all, so just show one notification
................................................................................

        # Who plus headline plus body
        else:
            n1 = tup[1] + ": " + tup[2]
            n2 = tup[3]

        # Build actual notification
        anyrx = True
        n = notify2.Notification(n1, n2)
        log("Notification: " + n1 + ((", " + n2) if n2 else ""))
        try:
            n.show()
        except:
            traceback.format_exc()
            log("Notification not displayed")

    # Only shadows of our own typing on another device, so stay
    #  quiet
    if not anyrx:
        return

    # Worry about the LEDs?
    if leds and (not blinking) and is_locked:
        blink()

    # Play sound
    os.system("paplay --volume=40000 %s" % (cfg.sound,))