def join_thread(chat_obj,params): if not params: if not chat_obj.channel: chat_obj.show(_('Use /join <nickname> to talk to someone.\n')) chat_obj.set_channel([ ]) return param = params[0] if param[0] in '+-': prefix = param[0] param = param[1:] else: prefix = '' new_list = utility.split_list(param) old_list = chat_obj.channel[:] if prefix == '+': for item in old_list: if item not in new_list: new_list.append(item) elif prefix == '-': for item in new_list: if item in old_list: old_list.remove(item) else: chat_obj.show(_('Not joined to %s\n')%item) new_list = old_list for item in new_list: if item[0]!='#': result, thread = chat_obj.app.name_server.check_acquaintance(chat_obj.identity_list,item) yield 'wait',thread if not result: chat_obj.show( 'No %s in your aquaintances list.\n'% item,'grey') new_list.remove(item) chat_obj.set_channel(new_list) if new_list: chat_obj.show(_('Joined %s\n') % string.join(chat_obj.channel,',') ) else: chat_obj.show(_('Joined nobody\n') )
def do_listen(self, params): if not params: self.show(_('Listening to %s\n') % string.join(self.channels.get_listening(),', ') ) return param = params[0] if param[0] in '+-': prefix = param[0] param = param[1:] else: prefix = '' new_list = utility.split_list(param) for item in new_list: if item[:1] != '#': self.show(_('All channel names must begin with a # character.\n')) return old_list = self.channels.get_listening() if prefix == '+': for item in old_list: if item not in new_list: new_list.append(item) elif prefix == '-': for item in new_list: if item in old_list: old_list.remove(item) else: self.show(_('Not listening to %s\n')%item) new_list = old_list for item in new_list: self.channel_sub(item) for key in self.channels.list.keys(): self.channel_mute(key, key not in new_list) self.show(_('Listening to %s\n') % string.join(new_list,',') )
def do_giveto(self, param, augmentation): _giveto(self, utility.split_list(param[0]), param[1:], augmentation)
def do_msg(self, param, augmentation): self.send_message(utility.split_list(param[0]), param[1], None, augmentation)