Merge lp:~stefanor/ibid/meeting-nomessage-598094 into lp:~ibid-core/ibid/old-trunk-1.6

Proposed by Stefano Rivera
Status: Merged
Approved by: Stefano Rivera
Approved revision: 910
Merged at revision: 960
Proposed branch: lp:~stefanor/ibid/meeting-nomessage-598094
Merge into: lp:~ibid-core/ibid/old-trunk-1.6
Diff against target: 39 lines (+17/-8)
1 file modified
ibid/plugins/meetings.py (+17/-8)
To merge this branch: bzr merge lp:~stefanor/ibid/meeting-nomessage-598094
Reviewer Review Type Date Requested Status
Max Rabkin Approve
Jonathan Hitchcock Approve
Review via email: mp+28402@code.launchpad.net

Commit message

Don't try to process() events without a message in meeting

Description of the change

Proposed for 0.1 too

To post a comment you must log in.
Revision history for this message
Michael Gorven (mgorven) wrote :

Uh, why not event.type == 'message'?

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

What Michael said. Also, why not use @handler, and are we sure we don't want to log actions and state events?

910. By Stefano Rivera

Correctly log events that don't have messages or senders

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

r910

Revision history for this message
Jonathan Hitchcock (vhata) :
review: Approve
Revision history for this message
Max Rabkin (max-rabkin) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/meetings.py'
2--- ibid/plugins/meetings.py 2010-03-27 15:50:58 +0000
3+++ ibid/plugins/meetings.py 2010-07-04 15:17:26 +0000
4@@ -247,18 +247,27 @@
5 features = ('meeting',)
6
7 def process(self, event):
8- if 'channel' in event and 'source' in event \
9- and (event.source, event.channel) in meetings:
10+ if ('channel' in event and 'source' in event
11+ and (event.source, event.channel) in meetings):
12 meeting = meetings[(event.source, event.channel)]
13- message = event.message
14- if isinstance(message, dict):
15- message = message['raw']
16- meeting['log'].append({
17+
18+ log_event = {
19 'nick': event.sender['nick'],
20 'type': event.type,
21- 'message': message,
22 'time': event.time,
23- })
24+ }
25+
26+ if 'message' in event:
27+ message = event.message
28+ if isinstance(message, dict):
29+ message = message['raw']
30+ log_event['message'] = message
31+
32+ if 'sender' in event:
33+ log_event['nick'] = event.sender['nick']
34+
35+ meeting['log'].append(log_event)
36+
37 for response in event.responses:
38 type = 'message'
39 if response.get('action', False):

Subscribers

People subscribed via source and target branches