File: 04_fix-irc-client.patch

package info (click to toggle)
python-cobe 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 228 kB
  • ctags: 213
  • sloc: python: 1,087; makefile: 5
file content (40 lines) | stat: -rw-r--r-- 1,161 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Description: Fix the irc-client function.
Author: Guus Sliepen <guus@debian.org>
Last-Update: 2014-06-13

--- a/cobe/irc.py
+++ b/cobe/irc.py
@@ -63,9 +63,9 @@
             self.connection.join(self.log_channel)
 
     def on_pubmsg(self, conn, event):
-        user = irc.client.NickMask(event.source()).nick
+        user = irc.client.NickMask(event.source).nick
 
-        if event.target() == self.log_channel:
+        if event.target == self.log_channel:
             # ignore input in the log channel
             return
 
@@ -74,10 +74,10 @@
             return
 
         # only respond on channels
-        if not irc.client.is_channel(event.target()):
+        if not irc.client.is_channel(event.target):
             return
 
-        msg = event.arguments()[0]
+        msg = event.arguments[0]
 
         # strip pasted nicks from messages
         msg = re.sub("<\S+>\s+", "", msg)
@@ -105,7 +105,7 @@
 
         if to == self.nick:
             reply = self.brain.reply(text).encode("utf-8")
-            conn.privmsg(event.target(), "%s: %s" % (user, reply))
+            conn.privmsg(event.target, "%s: %s" % (user, reply))
 
 
 class Runner: