def execute(self, user, name): if name.startswith('#'): channel = Channel.find_by_name(name) if user.is_operator: if channel is None: self.service.msg(user, '등록되지 않은 채널입니다.') return else: if channel is not None: if (channel.get_flags_by_user(user) & Flags.OWNER) == 0: self.service.msg(user, '권한이 없습니다.') return else: self.service.msg(user, '권한이 없습니다.') return self.service.msg(user, '\x02=== {} 채널 정보 ===\x02', channel.name) self.service.msg(user, '채널 등록일: {}', channel.created_on) else: account = Account.find_by_nick(name) if (not user.is_operator) and (account != user.account): self.service.msg(user, '권한이 없습니다. 오퍼레이터 인증을 해 주세요.') return if account is None: self.service.msg(user, '등록되지 않은 계정입니다.') return self.service.msg(user, '\x02=== {} 계정 정보 ===\x02', account.name.name) self.service.msg(user, '이메일: {}', account.email) self.service.msg(user, '대표 계정명: {}', account.name.name) self.service.msg(user, '보조 계정명: {}', (', '.join([nick.name for nick in account.aliases])) or '없음') self.service.msg(user, '가상 호스트: {}', account.vhost or '없음') self.service.msg(user, '계정 등록일: {}', account.created_on) self.service.msg(user, '마지막 로그인: {}', account.last_login)
def FJOIN(self, server, *params): channel = Channel.find_by_name(params[0]) if not channel: return real_channel = self.service.server.channels.get(channel.name.lower()) if not real_channel: return usermodes = params[-1].split() for usermode in usermodes: uid = usermode.split(',')[1] user = self.service.server.users[uid] flags = channel.get_flags_by_user(user) modes = '' for flag, mode in self.modemap.items(): if (flags & flag) != 0: modes += mode self.service.writesvsuserline('FMODE {} {} +{} {}', real_channel.name, real_channel.timestamp, modes, user.uid)