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
=== modified file 'gwibber/actions.py'
--- gwibber/actions.py 2010-08-08 01:17:30 +0000
+++ gwibber/actions.py 2010-08-23 13:50:53 +0000
@@ -82,6 +82,12 @@
82 image = resources.get_ui_asset("gwibber.svg")82 image = resources.get_ui_asset("gwibber.svg")
83 expire_timeout = 500083 expire_timeout = 5000
84 n = gwibber.microblog.util.notify(_("Liked"), _("You have marked this message as liked."), image, expire_timeout)84 n = gwibber.microblog.util.notify(_("Liked"), _("You have marked this message as liked."), image, expire_timeout)
85
86 @classmethod
87 def include(self, client, msg):
88 if "like" in client.model.services[msg["service"]]["features"]:
89 if msg.get("sender", {}).get("is_me", 0):
90 return True
8591
86class delete(MessageAction):92class delete(MessageAction):
87 icon = "gtk-delete"93 icon = "gtk-delete"
8894
=== modified file 'gwibber/microblog/dispatcher.py'
--- gwibber/microblog/dispatcher.py 2010-08-19 15:55:03 +0000
+++ gwibber/microblog/dispatcher.py 2010-08-23 13:50:53 +0000
@@ -291,12 +291,13 @@
291 params = ["account", "operation", "args", "transient"]291 params = ["account", "operation", "args", "transient"]
292 operation = None292 operation = None
293 293
294 if "account" in o and self.collector.get_account(o["account"]):
295 account = self.collector.get_account(o["account"])
296
294 if "id" in o:297 if "id" in o:
295 operation = self.collector.get_operation_by_id(o["id"])298 operation = self.collector.get_operation_by_id(o["id"])
296 elif all(i in o for i in params):299 elif "operation" in o and self.collector.validate_operation(account, o["operation"]):
297 operation = [tuple(o[i] for i in params)]300 operation = util.compact([(account, o["operation"], o["args"], None)])
298 elif "account" in o and self.accounts.record_exists(o["account"]):
299 operation = self.collector.account_to_operations(o["account"])
300301
301 if operation:302 if operation:
302 MapAsync(perform_operation, operation, self.loading_complete, self.loading_failed)303 MapAsync(perform_operation, operation, self.loading_complete, self.loading_failed)