[Twisted-Python] Another twisted-im patch
screwtape at froup.com
screwtape at froup.com
Sat Jan 11 22:46:18 MST 2003
Notwithstanding the last message about twisted.im being nuked and
replaced with something almost but not quite entirely different :)
here's a diff that I feel makes twisted-im a little more useful.
--
___________ ____________________________
| Screwtape | Reply-To: munged on Usenet |________ ______ ____ __ _ _ _
|
| "The cruel angel's thesis bleeds"
|
-------------- next part --------------
Index: twisted/im/ircsupport.py
===================================================================
RCS file: /cvs/Twisted/twisted/im/ircsupport.py,v
retrieving revision 1.21
diff -u -r1.21 ircsupport.py
--- twisted/im/ircsupport.py 12 Jan 2003 04:28:45 -0000 1.21
+++ twisted/im/ircsupport.py 12 Jan 2003 05:35:51 -0000
@@ -40,11 +40,12 @@
self.status=status
self.chat.getContactsList().setContactStatus(self)
- def sendMessage(self, text, meta=None):
- if meta and meta.get("style", None) == "emote":
- self.client.ctcpMakeQuery(self.name,[('ACTION', text)])
- return succeed(text)
- self.client.msg(self.name,text)
+ def sendMessage(self, text, meta={}):
+ for line in string.split(text, '\n'):
+ if meta and meta.get("style", None) == "emote":
+ self.client.ctcpMakeQuery(self.name,[('ACTION', line)])
+ else:
+ self.client.msg(self.name, line)
return succeed(text)
class IRCGroup(basesupport.AbstractGroup):
@@ -96,7 +97,7 @@
if self.account.password:
self.sendLine("PASS :%s" % self.account.password)
self.setNick(self.account.nickname)
- self.sendLine("USER %s foo bar :GTK-IM user"%self.nickname)
+ self.sendLine("USER %s foo bar :Twisted-IM user"%self.nickname)
for channel in self.account.channels:
self.joinGroup(channel)
self.account._isOnline=1
More information about the Twisted-Python
mailing list