Merge lp:~mgorven/ibid/smtp-343784 into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Michael Gorven
Status: Merged
Approved by: Jonathan Hitchcock
Approved revision: 587
Merged at revision: not available
Proposed branch: lp:~mgorven/ibid/smtp-343784
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~mgorven/ibid/smtp-343784
Reviewer Review Type Date Requested Status
Stefano Rivera Approve
Jonathan Hitchcock Approve
Review via email: mp+4551@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Gorven (mgorven) wrote :

Fixes the SMTP exception and also improves handling of Launchpad emails in the
bzr plugin.

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

Fine with me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/config.ini'
2--- ibid/config.ini 2009-03-02 11:59:56 +0000
3+++ ibid/config.ini 2009-03-16 21:33:13 +0000
4@@ -36,7 +36,7 @@
5 [[pb]]
6 [[reaper]]
7 type = silc
8- server = silc.za.net
9+ server = reaper.org
10 channels = ibid,
11 name = Ibid Bot
12 [[campfire]]
13
14=== modified file 'ibid/plugins/bzr.py'
15--- ibid/plugins/bzr.py 2009-03-10 10:34:37 +0000
16+++ ibid/plugins/bzr.py 2009-03-16 21:25:00 +0000
17@@ -116,10 +116,14 @@
18 def launchpad(self, event):
19 if event.source.lower() not in ibid.sources \
20 or ibid.sources[event.source.lower()].type != 'smtp' \
21- or 'X-Launchpad-Branch' not in event.headers:
22+ or 'X-Launchpad-Project' not in event.headers:
23 return
24
25 event.processed = True
26+
27+ if 'X-Launchpad-Branch' not in event.headers or 'X-Launchpad-Branch-Revision-Number' not in event.headers:
28+ return
29+
30 if event.headers['X-Launchpad-Branch'] in self.launchpad_branches:
31 self.remote_committed(self.launchpad_branches[event.headers['X-Launchpad-Branch']], int(event.headers['X-Launchpad-Branch-Revision-Number']))
32
33
34=== modified file 'ibid/source/smtp.py'
35--- ibid/source/smtp.py 2009-02-23 20:29:44 +0000
36+++ ibid/source/smtp.py 2009-03-16 21:15:23 +0000
37@@ -54,13 +54,13 @@
38 event = Event(self.name, u'message')
39 (realname, address) = parseaddr(mail['from'])
40 event.channel = event.sender['connection'] = event.sender['id'] = unicode(address, 'utf-8', 'replace')
41- event.sender['nick'] = realname != '' and unicode(realname, 'utf-8', 'replace') or address
42+ event.sender['nick'] = realname != '' and unicode(realname, 'utf-8', 'replace') or event.channel
43 event.public = False
44 event.addressed = True
45 event.subject = unicode(mail['subject'], 'utf-8', 'replace')
46 event.headers = dict((i[0], unicode(i[1], 'utf-8', 'replace')) for i in mail.items())
47
48- message = mail.is_multipart() and mail.get_payload()[0] or mail.get_payload()
49+ message = mail.is_multipart() and mail.get_payload()[0].get_payload() or mail.get_payload()
50 if len(message) > 0:
51 event.message = stripsig.sub('', message).strip().replace('\n', ' ')
52 else:

Subscribers

People subscribed via source and target branches