Mercurial > xib
comparison bot.py @ 126:eb65b875be0a
isinstance(participant, participant) → isinstance(participant, Participant)
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Thu, 14 Jan 2010 10:25:32 +0100 |
parents | 99f3dee1fad7 |
children | db3f648a9e9e |
comparison
equal
deleted
inserted
replaced
125:efdc038e757a | 126:eb65b875be0a |
---|---|
829 args_array = [] | 829 args_array = [] |
830 if len(command) > 1: | 830 if len(command) > 1: |
831 args_array = command[1:] | 831 args_array = command[1:] |
832 command = command[0] | 832 command = command[0] |
833 | 833 |
834 if isinstance(participant, participant) and bot_admin != participant.bot_admin: | 834 if isinstance(participant, Participant) and bot_admin != participant.bot_admin: |
835 bot_admin = participant.bot_admin | 835 bot_admin = participant.bot_admin |
836 | 836 |
837 if command == 'xmpp-participants': | 837 if command == 'xmpp-participants': |
838 if not isinstance(participant, participant): | 838 if not isinstance(participant, Participant): |
839 for b in self.bridges: | 839 for b in self.bridges: |
840 xmpp_participants_nicknames = b.get_participants_nicknames_list(protocols=['xmpp']) | 840 xmpp_participants_nicknames = b.get_participants_nicknames_list(protocols=['xmpp']) |
841 ret += '\nparticipants on '+b.xmpp_room_jid+' ('+str(len(xmpp_participants_nicknames))+'): '+' '.join(xmpp_participants_nicknames) | 841 ret += '\nparticipants on '+b.xmpp_room_jid+' ('+str(len(xmpp_participants_nicknames))+'): '+' '.join(xmpp_participants_nicknames) |
842 return ret | 842 return ret |
843 else: | 843 else: |
844 xmpp_participants_nicknames = participant.bridge.get_participants_nicknames_list(protocols=['xmpp']) | 844 xmpp_participants_nicknames = participant.bridge.get_participants_nicknames_list(protocols=['xmpp']) |
845 return '\nparticipants on '+participant.bridge.xmpp_room_jid+' ('+str(len(xmpp_participants_nicknames))+'): '+' '.join(xmpp_participants_nicknames) | 845 return '\nparticipants on '+participant.bridge.xmpp_room_jid+' ('+str(len(xmpp_participants_nicknames))+'): '+' '.join(xmpp_participants_nicknames) |
846 | 846 |
847 elif command == 'irc-participants': | 847 elif command == 'irc-participants': |
848 if not isinstance(participant, participant): | 848 if not isinstance(participant, Participant): |
849 for b in self.bridges: | 849 for b in self.bridges: |
850 irc_participants_nicknames = b.get_participants_nicknames_list(protocols=['irc']) | 850 irc_participants_nicknames = b.get_participants_nicknames_list(protocols=['irc']) |
851 ret += '\nparticipants on '+b.irc_room+' at '+b.irc_server+' ('+str(len(irc_participants_nicknames))+'): '+' '.join(irc_participants_nicknames) | 851 ret += '\nparticipants on '+b.irc_room+' at '+b.irc_server+' ('+str(len(irc_participants_nicknames))+'): '+' '.join(irc_participants_nicknames) |
852 return ret | 852 return ret |
853 else: | 853 else: |
924 | 924 |
925 | 925 |
926 elif command in ['remove-bridge', 'restart-bridge', 'stop-bridge']: | 926 elif command in ['remove-bridge', 'restart-bridge', 'stop-bridge']: |
927 # we need to know which bridge the command is for | 927 # we need to know which bridge the command is for |
928 if len(args_array) == 0: | 928 if len(args_array) == 0: |
929 if isinstance(participant, participant): | 929 if isinstance(participant, Participant): |
930 b = participant.bridge | 930 b = participant.bridge |
931 else: | 931 else: |
932 return 'You must specify a bridge. '+self.respond('bridges') | 932 return 'You must specify a bridge. '+self.respond('bridges') |
933 else: | 933 else: |
934 try: | 934 try: |