def topic(self, channel, topic=None): channel = encode(channel) if topic is not None: topic = encode(topic) d = self.topicDeferreds.get(channel) if d is None: d = self.topicDeferreds[channel] = Deferred() IRCClient.topic(self, channel, topic) return d
def tinyurl(uri): #u = url.URL.fromString(API).child('create.php').add('url', uri) # XXX: Sigh. TinyURL makes it very obvious that it was written in PHP by # a retard. Quoted characters never get unquoted and then you get broken # URLs. Kevin Gilbertson, please burn in hell for eternity while having # ants bite your urethra. u = str( url.URL.fromString(API).child('create.php')) + '?url=' + encode(uri) return getPage(u).addCallback(extractTinyUrl)
def __init__(self, appStore, serviceID, factory, portal, config): self.serviceID = serviceID self.factory = factory self.portal = portal self.config = config self.appStore = appStore self.nickname = encode(config.nickname) self.topicDeferreds = {} self.isupported = {} self.authenticatedUsers = {}
def signedOn(self): log.msg('Signed on.') self.factory.resetDelay() self.setModes() channels = self.config.channels for channel in channels: self.join(encode(channel)) log.msg('Joined channels: %r' % (channels,))
def say(self, text): """ Say C{text} in the current channel (or private) over the protocol. """ self.protocol.msg(encode(self.channel), encode(text))
def privateNotice(self, text): """ Send a private I{NOTICE} to L{self.user}. """ self.protocol.notice(encode(self.user.nickname), encode(text))
def notice(self, text): """ Notice C{text} to the current channel. """ self.protocol.notice(encode(self.channel), encode(text))
def part(self, channel): self.config.removeChannel(channel) return IRCClient.part(self, encode(channel))
def join(self, channel, key=None): self.config.addChannel(channel) return IRCClient.join(self, encode(channel), key)