Mercurial > xib
comparison bot.py @ 190:6db99e458168
fixed calls to Bot.restart_bridges_delayed(), arguments changed in f52cb2f6e273328e73d75ab4ecf214c8dc9dfe1b
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 21 Feb 2010 11:53:47 +0100 |
parents | bd185885d4ca |
children | c2a8586e64b5 |
comparison
equal
deleted
inserted
replaced
189:e04410e7e527 | 190:6db99e458168 |
---|---|
155 r = reason.getData() | 155 r = reason.getData() |
156 if r == 'The conference component is shutting down': | 156 if r == 'The conference component is shutting down': |
157 # MUC server is going down, try to restart the bridges in 1 minute | 157 # MUC server is going down, try to restart the bridges in 1 minute |
158 bridges = self.findBridges([from_.getDomain()]) | 158 bridges = self.findBridges([from_.getDomain()]) |
159 m = 'The MUC server '+from_.getDomain()+' seems to be going down, the bot will try to recreate all bridges related to this server in 1 minute' | 159 m = 'The MUC server '+from_.getDomain()+' seems to be going down, the bot will try to recreate all bridges related to this server in 1 minute' |
160 error = (say_levels.warning, m) | 160 error = [say_levels.warning, m] |
161 self.restart_bridges_delayed(bridges, 60, error) | 161 self.restart_bridges_delayed(bridges, 60, error) |
162 return | 162 return |
163 elif r == '': | 163 elif r == '': |
164 r = 'None given' | 164 r = 'None given' |
165 else: | 165 else: |
262 err = error.getAttr('type')+' '+c.getName() | 262 err = error.getAttr('type')+' '+c.getName() |
263 if err == 'cancel remote-server-not-found': | 263 if err == 'cancel remote-server-not-found': |
264 # Remote server not found | 264 # Remote server not found |
265 # Stop bridges that depend on this server | 265 # Stop bridges that depend on this server |
266 bridges = self.findBridges([from_.getDomain()]) | 266 bridges = self.findBridges([from_.getDomain()]) |
267 error_message = '[Error] XMPP Remote server not found: '+from_.getDomain() | 267 error = [say_levels.error, 'XMPP Remote server not found: '+from_.getDomain()] |
268 self.restart_bridges_delayed(bridges, 60, error_message) | 268 self.restart_bridges_delayed(bridges, 60, error) |
269 else: | 269 else: |
270 raise Exception(presence.__str__(fancy=1).encode('utf-8')) | 270 raise Exception(presence.__str__(fancy=1).encode('utf-8')) |
271 | 271 |
272 elif resource != bridge.bot.nickname: | 272 elif resource != bridge.bot.nickname: |
273 real_jid = None | 273 real_jid = None |