comparison MoinMoin/jabber/xmppbot.py @ 2088:a99ed13fec1e

Introduce a shared secret for wiki-bot communication + some code style fixes.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Sun, 03 Jun 2007 19:44:56 +0200
parents d72f126157f7
children 4ec961fd40d9
comparison
equal deleted inserted replaced
2087:a94187915111 2088:a99ed13fec1e
18 from pyxmpp.jid import JID 18 from pyxmpp.jid import JID
19 from pyxmpp.streamtls import TLSSettings 19 from pyxmpp.streamtls import TLSSettings
20 from pyxmpp.message import Message 20 from pyxmpp.message import Message
21 21
22 from xmlrpcbot import NotificationCommand 22 from xmlrpcbot import NotificationCommand
23
23 24
24 class Contact: 25 class Contact:
25 """Abstraction of a roster item / contact 26 """Abstraction of a roster item / contact
26 27
27 This class handles some logic related to keeping track of 28 This class handles some logic related to keeping track of
215 # If we get presence, this contact should already be known 216 # If we get presence, this contact should already be known
216 if bare_jid in self.contacts: 217 if bare_jid in self.contacts:
217 contact = self.contacts[bare_jid] 218 contact = self.contacts[bare_jid]
218 219
219 if self.config.verbose: 220 if self.config.verbose:
220 self.log(str(contact) + ", going OFFLINE.") 221 self.log("%s, going OFFLINE." % contact)
221 222
222 try: 223 try:
223 # Send queued messages now, as we can't guarantee to be 224 # Send queued messages now, as we can't guarantee to be
224 # alive the next time this contact becomes available. 225 # alive the next time this contact becomes available.
225 if len(contact.resources) == 1: 226 if len(contact.resources) == 1: