Merge lp:~roignac/gwibber/Bug616798 into lp:gwibber

Proposed by Vadim Rutkovsky
Status: Merged
Merged at revision: 822
Proposed branch: lp:~roignac/gwibber/Bug616798
Merge into: lp:gwibber
Diff against target: 38 lines (+11/-4)
2 files modified
gwibber/actions.py (+6/-0)
gwibber/microblog/dispatcher.py (+5/-4)
To merge this branch: bzr merge lp:~roignac/gwibber/Bug616798
Reviewer Review Type Date Requested Status
gwibber-committers Pending
Review via email: mp+33383@code.launchpad.net

Description of the change

A fix for incorrect 'Like' and 'Delete' implementation (at least, for Identica and Twitter). Not sure about one thing - after message is being deleted, it should be removed from Db/cache, maybe

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gwibber/actions.py'
2--- gwibber/actions.py 2010-08-08 01:17:30 +0000
3+++ gwibber/actions.py 2010-08-23 13:50:53 +0000
4@@ -82,6 +82,12 @@
5 image = resources.get_ui_asset("gwibber.svg")
6 expire_timeout = 5000
7 n = gwibber.microblog.util.notify(_("Liked"), _("You have marked this message as liked."), image, expire_timeout)
8+
9+ @classmethod
10+ def include(self, client, msg):
11+ if "like" in client.model.services[msg["service"]]["features"]:
12+ if msg.get("sender", {}).get("is_me", 0):
13+ return True
14
15 class delete(MessageAction):
16 icon = "gtk-delete"
17
18=== modified file 'gwibber/microblog/dispatcher.py'
19--- gwibber/microblog/dispatcher.py 2010-08-19 15:55:03 +0000
20+++ gwibber/microblog/dispatcher.py 2010-08-23 13:50:53 +0000
21@@ -291,12 +291,13 @@
22 params = ["account", "operation", "args", "transient"]
23 operation = None
24
25+ if "account" in o and self.collector.get_account(o["account"]):
26+ account = self.collector.get_account(o["account"])
27+
28 if "id" in o:
29 operation = self.collector.get_operation_by_id(o["id"])
30- elif all(i in o for i in params):
31- operation = [tuple(o[i] for i in params)]
32- elif "account" in o and self.accounts.record_exists(o["account"]):
33- operation = self.collector.account_to_operations(o["account"])
34+ elif "operation" in o and self.collector.validate_operation(account, o["operation"]):
35+ operation = util.compact([(account, o["operation"], o["args"], None)])
36
37 if operation:
38 MapAsync(perform_operation, operation, self.loading_complete, self.loading_failed)