Merge lp:~stefanor/ibid/memo-336566 into lp:~ibid-core/ibid/old-trunk-pack-0.92

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

Another branch hijack

Revision history for this message
Michael Gorven (mgorven) wrote :

Those SA relations are hacky but actually work!
 review approve

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/memo.py'
2--- ibid/plugins/memo.py 2009-03-18 11:36:41 +0000
3+++ ibid/plugins/memo.py 2009-04-18 22:51:13 +0000
4@@ -36,8 +36,8 @@
5 self.private = private
6 self.delivered = False
7
8-Memo.sender = relation(Identity, primaryjoin=Memo.from_id==Identity.id)
9-Memo.recipient = relation(Identity, primaryjoin=Memo.to_id==Identity.id)
10+Identity.memos_sent = relation(Memo, primaryjoin=Identity.id==Memo.from_id, backref='sender')
11+Identity.memos_recvd = relation(Memo, primaryjoin=Identity.id==Memo.to_id, backref='recipient')
12
13 class Tell(Processor):
14 u"""(tell|pm|privmsg|msg) <person> <message>"""
15@@ -60,8 +60,10 @@
16 if not identity:
17 identity = account.identities[0]
18 if not to:
19- event.addresponse(u"I don't know who %s is", who)
20- return
21+ to = Identity(event.source, who)
22+ session.save(to)
23+ session.flush()
24+ log.info(u"Created identity %s for %s on %s", to.id, to.identity, to.source)
25
26 if permission(u'recvmemo', to.account and to.account.id or None, to.source) != 'yes':
27 event.addresponse(u'Just tell %s yourself', who)
28
29=== modified file 'scripts/ibid-plugin'
30--- scripts/ibid-plugin 2009-03-16 20:55:20 +0000
31+++ scripts/ibid-plugin 2009-03-19 19:25:22 +0000
32@@ -46,6 +46,7 @@
33
34 class TestSource(dict):
35 type = 'test'
36+ permissions = []
37
38 ibid.sources[u'test_source'] = TestSource()
39

Subscribers

People subscribed via source and target branches