webXMPP

Check-in [b56a71baa3]
Login

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

Overview
Comment:Catch up w. old git source. Catch edge case for status update. Move to Fossil.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:b56a71baa3a8c1d6730fb18ece7d1f4c59ca48616930dfc69c56dd650aaf5029
User & Date: web 2018-07-01 14:20:53
Context
2018-09-19
23:18
Snapshot, a notification client for DBus-ish mobile devices. check-in: 4a044ab760 user: vandys tags: master, trunk
2018-07-01
14:20
Catch up w. old git source. Catch edge case for status update. Move to Fossil. check-in: b56a71baa3 user: web tags: master, trunk
2018-03-13
04:00
Some debug support tooling for presence data structures check-in: 5bf9f900bf user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added .fossil-settings/ignore-glob.







>
>
>
1
2
3
*.pyc
certs
*.log

Deleted .gitignore.

1
2
3
4
*.pyc
certs
*.log
chore
<
<
<
<








Changes to acct_xmpp.py.

35
36
37
38
39
40
41
42
43
44
45

46
47
48
49
50
51
52
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
    def send(self, towhom, msg):
	self.conn.send( xmpp.Message(towhom, msg) )

    # Callback from XMPP stack when we get a message
    def message(self, conn, msg):
	sender = msg.getFrom()
	recip = msg.getTo()
	body  = toascii(msg.getBody())
	if body is None:
	    # No data; typing, paused, etc.
	    return

	sys.stderr.write("Message received from %s for %s\n" %
	    (sender, self.acct))
	sys.stderr.write("  Body: %s\n" % (body,))
	self.user.add(True, aname(sender), toascii(body))

    # Stop this Account; the user has gone away
    # We close off XMPP; the thread should come out of its loop
................................................................................
	self.stopping = True

    # Update to presence status of somebody
    def presence(self, conn, presence):
	user = self.user

	# Debug, log so we can break out all the stupid XMPP cases
	if True:
	    f = open("/tmp/xmpp_presence.log", "a")
	    cPickle.dump(presence, f)
	    f.write("\n\n")
	    f.close()

	# Decode who sent to us
	# Note it can be somebody we haven't heard about; presence







|
|


>







 







|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
..
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
    def send(self, towhom, msg):
	self.conn.send( xmpp.Message(towhom, msg) )

    # Callback from XMPP stack when we get a message
    def message(self, conn, msg):
	sender = msg.getFrom()
	recip = msg.getTo()
	m = msg.getBody()
	if m is None:
	    # No data; typing, paused, etc.
	    return
	body  = toascii(m)
	sys.stderr.write("Message received from %s for %s\n" %
	    (sender, self.acct))
	sys.stderr.write("  Body: %s\n" % (body,))
	self.user.add(True, aname(sender), toascii(body))

    # Stop this Account; the user has gone away
    # We close off XMPP; the thread should come out of its loop
................................................................................
	self.stopping = True

    # Update to presence status of somebody
    def presence(self, conn, presence):
	user = self.user

	# Debug, log so we can break out all the stupid XMPP cases
	if False:
	    f = open("/tmp/xmpp_presence.log", "a")
	    cPickle.dump(presence, f)
	    f.write("\n\n")
	    f.close()

	# Decode who sent to us
	# Note it can be somebody we haven't heard about; presence