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
=== modified file 'ibid/config.ini'
--- ibid/config.ini 2009-03-02 11:59:56 +0000
+++ ibid/config.ini 2009-03-16 21:33:13 +0000
@@ -36,7 +36,7 @@
36 [[pb]]36 [[pb]]
37 [[reaper]]37 [[reaper]]
38 type = silc38 type = silc
39 server = silc.za.net39 server = reaper.org
40 channels = ibid,40 channels = ibid,
41 name = Ibid Bot41 name = Ibid Bot
42 [[campfire]]42 [[campfire]]
4343
=== modified file 'ibid/plugins/bzr.py'
--- ibid/plugins/bzr.py 2009-03-10 10:34:37 +0000
+++ ibid/plugins/bzr.py 2009-03-16 21:25:00 +0000
@@ -116,10 +116,14 @@
116 def launchpad(self, event):116 def launchpad(self, event):
117 if event.source.lower() not in ibid.sources \117 if event.source.lower() not in ibid.sources \
118 or ibid.sources[event.source.lower()].type != 'smtp' \118 or ibid.sources[event.source.lower()].type != 'smtp' \
119 or 'X-Launchpad-Branch' not in event.headers:119 or 'X-Launchpad-Project' not in event.headers:
120 return120 return
121121
122 event.processed = True122 event.processed = True
123
124 if 'X-Launchpad-Branch' not in event.headers or 'X-Launchpad-Branch-Revision-Number' not in event.headers:
125 return
126
123 if event.headers['X-Launchpad-Branch'] in self.launchpad_branches:127 if event.headers['X-Launchpad-Branch'] in self.launchpad_branches:
124 self.remote_committed(self.launchpad_branches[event.headers['X-Launchpad-Branch']], int(event.headers['X-Launchpad-Branch-Revision-Number']))128 self.remote_committed(self.launchpad_branches[event.headers['X-Launchpad-Branch']], int(event.headers['X-Launchpad-Branch-Revision-Number']))
125129
126130
=== modified file 'ibid/source/smtp.py'
--- ibid/source/smtp.py 2009-02-23 20:29:44 +0000
+++ ibid/source/smtp.py 2009-03-16 21:15:23 +0000
@@ -54,13 +54,13 @@
54 event = Event(self.name, u'message')54 event = Event(self.name, u'message')
55 (realname, address) = parseaddr(mail['from'])55 (realname, address) = parseaddr(mail['from'])
56 event.channel = event.sender['connection'] = event.sender['id'] = unicode(address, 'utf-8', 'replace')56 event.channel = event.sender['connection'] = event.sender['id'] = unicode(address, 'utf-8', 'replace')
57 event.sender['nick'] = realname != '' and unicode(realname, 'utf-8', 'replace') or address57 event.sender['nick'] = realname != '' and unicode(realname, 'utf-8', 'replace') or event.channel
58 event.public = False58 event.public = False
59 event.addressed = True59 event.addressed = True
60 event.subject = unicode(mail['subject'], 'utf-8', 'replace')60 event.subject = unicode(mail['subject'], 'utf-8', 'replace')
61 event.headers = dict((i[0], unicode(i[1], 'utf-8', 'replace')) for i in mail.items())61 event.headers = dict((i[0], unicode(i[1], 'utf-8', 'replace')) for i in mail.items())
6262
63 message = mail.is_multipart() and mail.get_payload()[0] or mail.get_payload()63 message = mail.is_multipart() and mail.get_payload()[0].get_payload() or mail.get_payload()
64 if len(message) > 0:64 if len(message) > 0:
65 event.message = stripsig.sub('', message).strip().replace('\n', ' ')65 event.message = stripsig.sub('', message).strip().replace('\n', ' ')
66 else:66 else:

Subscribers

People subscribed via source and target branches