Mercurial > xib
comparison bot.py @ 10:7cb790f5f243
No comment.
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 16 Aug 2009 23:35:15 +0200 |
parents | cb0daec4b778 |
children | 79b0a7f48a3e |
comparison
equal
deleted
inserted
replaced
9:4b2faa511f01 | 10:7cb790f5f243 |
---|---|
267 connection.bridge.getParticipant(nickname) | 267 connection.bridge.getParticipant(nickname) |
268 except NoSuchParticipantException: | 268 except NoSuchParticipantException: |
269 connection.bridge.addParticipant('irc', nickname) | 269 connection.bridge.addParticipant('irc', nickname) |
270 return | 270 return |
271 try: | 271 try: |
272 if not '!' in event.source(): | |
273 return | |
272 from_ = connection.bridge.getParticipant(event.source().split('!')[0]) | 274 from_ = connection.bridge.getParticipant(event.source().split('!')[0]) |
273 if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target() == connection.bridge.irc_room: | 275 if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target() == connection.bridge.irc_room: |
274 if from_.protocol in ['irc', 'both']: | 276 if from_.protocol in ['irc', 'both']: |
275 connection.bridge.removeParticipant('irc', from_.nickname, event.arguments()[0]) | 277 connection.bridge.removeParticipant('irc', from_.nickname, event.arguments()[0]) |
276 return | 278 return |
277 if event.eventtype() == 'nick' and from_.protocol == 'irc': | 279 if event.eventtype() == 'nick' and from_.protocol in ['irc', 'both']: |
278 from_.changeNickname(event.target(), 'xmpp') | 280 from_.changeNickname(event.target(), 'xmpp') |
279 except NoSuchParticipantException: | 281 except NoSuchParticipantException: |
280 return | 282 self.error('===> Debug: NoSuchParticipantException "'+event.source().split('!')[0]+'"', debug=True) |
281 except AttributeError: | 283 return |
282 pass | |
283 if event.eventtype() == 'pubmsg': | 284 if event.eventtype() == 'pubmsg': |
284 if from_.protocol == 'irc' or from_.protocol == 'both': | 285 if from_.protocol == 'irc' or from_.protocol == 'both': |
285 from_.sayOnXMPP(event.arguments()[0]) | 286 from_.sayOnXMPP(event.arguments()[0]) |
286 elif event.eventtype() == 'privmsg': | 287 elif event.eventtype() == 'privmsg': |
287 if event.target() == None: | 288 if event.target() == None: |