Merge lp:~max-rabkin/ibid/invite-705907 into lp:~ibid-core/ibid/old-trunk-1.6

Proposed by Max Rabkin
Status: Merged
Approved by: Stefano Rivera
Approved revision: 1008
Merged at revision: 1020
Proposed branch: lp:~max-rabkin/ibid/invite-705907
Merge into: lp:~ibid-core/ibid/old-trunk-1.6
Diff against target: 96 lines (+11/-9)
5 files modified
ibid/plugins/core.py (+3/-3)
ibid/plugins/identity.py (+1/-1)
ibid/plugins/sources.py (+2/-2)
ibid/source/irc.py (+3/-2)
ibid/source/silc.py (+2/-1)
To merge this branch: bzr merge lp:~max-rabkin/ibid/invite-705907
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve
Stefano Rivera Approve
Review via email: mp+47100@code.launchpad.net

Commit message

Handle invite events in Address, Ignore, Complain and Identity

To post a comment you must log in.
lp:~max-rabkin/ibid/invite-705907 updated
997. By marcog

Provide the possibility to join a channel with a key. Only supported in IRC so far.
Author: marcog
Approved by: Max Rabkin, Stefano Rivera
Fixes LP: #502294

998. By Stefano Rivera

URLErrors have reasons, but there are other HTTPErrors
Author: Stefano Rivera
Approved by: marcog, Max Rabkin
Fixes LP: #670855

999. By Stefano Rivera

Add parse_timestamp function to ibid.utils, use for parsing timestamps from Twitter.
Author: Stefano Rivera
Approved by: marcog, Max Rabkin
Fixes LP: #702815

1000. By Stefano Rivera

Add intersphinx links to Python documentation.
Author: Stefano Rivera
Approved by: marcog, Max Rabkin
Fixes LP: #

1001. By Keegan Carruthers-Smith

Use correct plurality in pending memos message
Author: Keegan Carruthers-Smith
Approved by: Max Rabkin, Stefano Rivera, marcog
Fixes LP: #634257

Revision history for this message
Stefano Rivera (stefanor) wrote :

This is not enough:

DEBUG source.atrum: Invited into #ibidtest2 by tumblingweed
DEBUG core.dispatcher: Received event from atrum source
INFO core.auth: Checking sources permission for None/202 (tumblingweed!<email address hidden>): no
DEBUG core.dispatcher: {'account': None, 'responses': [{'reply': u'Just do it yourself', 'address': True, 'target': u'#ibidtest2', 'conflate': True, 'source': u'atrum'}], 'complain': u'notauthed', 'source': u'atrum', 'addressed': True, 'processed': True, 'time': datetime.datetime(2011, 1, 21, 23, 16, 9, 353412), 'identity': 202, 'type': u'invite', 'public': False, 'channel': u'#ibidtest2', 'sender': {'nick': u'tumblingweed', 'connection': u'tumblingweed!<email address hidden>', 'id': u'tumblingweed'}}
DEBUG core.dispatcher: Returning event to atrum source
DEBUG source.atrum: Sent privmsg to #ibidtest2: Just do it yourself

review: Needs Fixing
lp:~max-rabkin/ibid/invite-705907 updated
1002. By Stefano Rivera

Add function get_regexp_op to ibid.db that returns a REGEXP op that works on Postgres too.
Author: Stefano Rivera
Approved by: Jonathan Hitchcock, marcog, Max Rabkin
Fixes LP: #595423

1003. By Dominic Cleal

Allow karma plugin to pick up karma changes when addressed=False (albeit with slightly different syntax)
Author: Dominic Cleal
Approved by: Stefano Rivera, Max Rabkin
Fixes LP: #672125

1006. By Max Rabkin

Rename channel to target_channel

1007. By Max Rabkin

Use unicode in irc joined events

Revision history for this message
Max Rabkin (max-rabkin) wrote :

Rebasing did something funny to the list of revisions but the diff looks right.

Revision history for this message
Max Rabkin (max-rabkin) wrote :

I'm having issues with libsilc atm, so could somebody please test this on SILC.

Revision history for this message
Stefano Rivera (stefanor) wrote :

I can't seem to invite on SILC with irssi. But otherwise LGTM

review: Approve
Revision history for this message
Stefano Rivera (stefanor) wrote :

DEBUG core.dispatcher: {'account': 1, 'responses': [{'source': u'reaper', 'reply': u'Happy Sunday, tumbleweed', 'target': u'48e8add50000000000000000000000000407c73fe5bfcee08da571e60e', 'conflate': True, 'address': False}], 'source': u'reaper', 'addressed': True, 'processed': True, 'time': datetime.datetime(2011, 2, 20, 20, 10, 14, 756252), 'identity': 11, 'message': {'raw': u'hi', 'deaddressed': u'hi', 'clean': u'hi', 'stripped': u'hi'}, 'type': u'message', 'public': False, 'channel': u'48e8add50000000000000000000000000407c73fe5bfcee08da571e60e', 'sender': {'nick': u'tumbleweed', 'connection': u'48e8add50000000000000000000000000407c73fe5bfcee08da571e60e', 'id': u'add599b915d243a54f8cd0991be85fce71830eeb'}}
DEBUG core.dispatcher: Returning event to reaper source
DEBUG source.reaper: Sent message to 48e8add50000000000000000000000000407c73fe5bfcee08da571e60e: Happy Sunday, tumbleweed
2011-02-20 22:10:15+0200 [-] Traceback (most recent call last):
2011-02-20 22:10:15+0200 [-] File "/home/stefanor/bzr/ibid/stefanor/tibid/ibid/source/silc.py", line 176, in notify_invite
2011-02-20 22:10:15+0200 [-] event = self._create_event(u'invite', inviter, inviter)
2011-02-20 22:10:15+0200 [-] File "/home/stefanor/bzr/ibid/stefanor/tibid/ibid/source/silc.py", line 39, in _create_event
2011-02-20 22:10:15+0200 [-] event.channel = unicode(channel.channel_name, 'utf-8', 'replace')
2011-02-20 22:10:15+0200 [-] AttributeError: 'SilcUser' object has no attribute 'channel_name'

review: Needs Fixing
lp:~max-rabkin/ibid/invite-705907 updated
1008. By Max Rabkin

Users aren't channels on SILC

Revision history for this message
Stefano Rivera (stefanor) :
review: Approve
Revision history for this message
Jonathan Hitchcock (vhata) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/core.py'
2--- ibid/plugins/core.py 2010-06-22 22:20:18 +0000
3+++ ibid/plugins/core.py 2011-02-21 11:38:10 +0000
4@@ -70,7 +70,7 @@
5
6 priority = -1500
7 addressed = False
8- event_types = (u'message', u'action', u'notice')
9+ event_types = (u'message', u'action', u'notice', u'invite')
10
11 nicks = ListOption('ignore', 'List of nicks to ignore', [])
12
13@@ -97,7 +97,7 @@
14 priority = 1600
15 processed = True
16 addressed = False
17- event_types = ('message', 'action', 'notice', 'state')
18+ event_types = (u'message', u'action', u'notice', u'state', u'invite')
19
20 acknowledgements = ListOption('acknowledgements', 'Responses for positive acknowledgements',
21 (u'Okay', u'Sure', u'Done', u'Righto', u'Alrighty', u'Yessir'))
22@@ -130,7 +130,7 @@
23
24 priority = 950
25 processed = True
26- event_types = ('message', 'action')
27+ event_types = (u'message', u'action', u'invite')
28
29 complaints = DictOption('complaints', 'Complaint responses', {
30 'nonsense': (
31
32=== modified file 'ibid/plugins/identity.py'
33--- ibid/plugins/identity.py 2010-04-26 10:19:16 +0000
34+++ ibid/plugins/identity.py 2011-02-21 11:38:10 +0000
35@@ -451,7 +451,7 @@
36 priority = -1600
37 addressed = False
38 processed = True
39- event_types = (u'message', u'state', u'action', u'notice')
40+ event_types = (u'message', u'state', u'action', u'notice', u'invite')
41
42 @handler
43 def handle(self, event):
44
45=== modified file 'ibid/plugins/sources.py'
46--- ibid/plugins/sources.py 2011-01-21 22:01:13 +0000
47+++ ibid/plugins/sources.py 2011-02-21 11:38:10 +0000
48@@ -90,9 +90,9 @@
49 @handler
50 @authorise()
51 def invited(self, event):
52- event.addresponse(u'Joining %s', event.channel,
53+ event.addresponse(u'Joining %s', event.target_channel,
54 target=event.sender['nick'])
55- ibid.sources[event.source].join(event.channel)
56+ ibid.sources[event.source].join(event.target_channel)
57
58 class NickServ(Processor):
59 event_types = (u'notice',)
60
61=== modified file 'ibid/source/irc.py'
62--- ibid/source/irc.py 2011-01-21 22:01:13 +0000
63+++ ibid/source/irc.py 2011-02-21 11:38:10 +0000
64@@ -173,7 +173,8 @@
65 user = unicode(user, 'utf-8', 'replace')
66 channel = unicode(channel, 'utf-8', 'replace')
67
68- event = self._create_event(u'invite', user, channel)
69+ event = self._create_event(u'invite', user, user)
70+ event.target_channel = channel
71 event.public = False
72 event.addressed = True
73 self.factory.log.debug(u'Invited into %s by %s',
74@@ -218,7 +219,7 @@
75
76 def joined(self, channel):
77 event = Event(self.factory.name, u'source')
78- event.channel = channel
79+ event.channel = unicode(channel, 'utf-8', 'replace')
80 event.status = u'joined'
81 ibid.dispatcher.dispatch(event)
82
83
84=== modified file 'ibid/source/silc.py'
85--- ibid/source/silc.py 2010-12-24 16:20:42 +0000
86+++ ibid/source/silc.py 2011-02-21 11:38:10 +0000
87@@ -173,7 +173,8 @@
88 del self.users[self._to_hex(user.fingerprint)]
89
90 def notify_invite(self, channel, channel_name, inviter):
91- event = self._create_event(u'invite', inviter, channel)
92+ event = self._create_event(u'invite', inviter, None)
93+ event.target_channel = channel
94 event.public = False
95 event.addressed = True
96 self.factory.log.debug(u'Invited into %s by %s',

Subscribers

People subscribed via source and target branches