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

Proposed by Vadim Rutkovsky
Status: Rejected
Rejected by: Robert Bruce Park
Proposed branch: lp:~roignac/gwibber/Bug548524
Merge into: lp:gwibber
Diff against target: 48 lines (+5/-3)
3 files modified
gwibber/actions.py (+2/-3)
gwibber/microblog/twitter.py (+2/-0)
gwibber/microblog/util/__init__.py (+1/-0)
To merge this branch: bzr merge lp:~roignac/gwibber/Bug548524
Reviewer Review Type Date Requested Status
Robert Bruce Park Disapprove
gwibber-committers Pending
Review via email: mp+33991@code.launchpad.net

Description of the change

Fixes LP:548524 - when sending message using twitter, group tags are also replaced with hashtags. Also, moved PARSE_GROUP variable to util module.

To post a comment you must log in.
Revision history for this message
Robert Bruce Park (robru) wrote :

Thanks for taking the time to submit this patch, unfortunately Gwibber has gone through extensive changes recently and your patch no longer applies to the latest codebase.

Fortunately, the bug you were attempting to fix is no longer present in the current codebase. The new Twitter plugin does not do any parsing/munging of group or hashtags, so currently if you were to send a group tag to Twitter using Gwibber, Twitter would receive the message as you wrote it.

Please try out the latest Gwibber, I think you'll be quite pleased with what we've accomplished.

review: Disapprove

Unmerged revisions

832. By Vadim Rutkovsky

group tags are replaced with hashtags when message is sent from Twitter

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-26 19:06:44 +0000
3+++ gwibber/actions.py 2010-08-28 11:41:05 +0000
4@@ -43,7 +43,6 @@
5 class retweet(MessageAction):
6 icon = "mail-forward"
7 label = _("R_etweet")
8- PARSE_GROUP = re.compile("\B!([A-Za-z0-9_\-]+|@[A-Za-z0-9_\-]$)")
9
10 @classmethod
11 def action(self, w, client, msg):
12@@ -51,9 +50,9 @@
13 text = RETWEET_FORMATS[client.model.settings["retweet_style"]]
14 symbol = "RD" if msg["service"] == "identica" else "RT"
15 text = text.format(text=msg["text"], nick=msg["sender"]["nick"], R=symbol)
16- #replace ! with # if identica service
17+ #replace ! with # if service is identica
18 if msg["service"] == "identica" and client.model.settings["global_retweet"]:
19- text = self.PARSE_GROUP.sub('#\\1', text)
20+ text = gwibber.microblog.util.PARSE_GROUP.sub('#\\1', text)
21
22 if not client.model.settings["global_retweet"]:
23 client.message_target.set_target(msg, "repost")
24
25=== modified file 'gwibber/microblog/twitter.py'
26--- gwibber/microblog/twitter.py 2010-08-26 19:14:43 +0000
27+++ gwibber/microblog/twitter.py 2010-08-28 11:41:05 +0000
28@@ -240,6 +240,8 @@
29 return self._get("favorites/create/%s.json" % message["mid"], None, post=True, do=1)
30
31 def send(self, message):
32+ # replace identica groups (!) with hashtags if message is sent to twitter
33+ message = util.PARSE_GROUP.sub('#\\1', message)
34 return self._get("statuses/update.json", post=True, single=True,
35 status=message, source="gwibbernet")
36
37
38=== modified file 'gwibber/microblog/util/__init__.py'
39--- gwibber/microblog/util/__init__.py 2010-08-22 18:30:36 +0000
40+++ gwibber/microblog/util/__init__.py 2010-08-28 11:41:05 +0000
41@@ -30,6 +30,7 @@
42 PARSE_NICK = re.compile("\B@([A-Za-z0-9_]+|@[A-Za-z0-9_]$)")
43 PARSE_HASH = re.compile("\B#([A-Za-z0-9_\-]+|@[A-Za-z0-9_\-]$)")
44 PARSE_URLS = re.compile(r"<[^<]*?/?>")
45+PARSE_GROUP = re.compile("\B!([A-Za-z0-9_\-]+|@[A-Za-z0-9_\-]$)")
46
47 def strip_urls(text):
48 return PARSE_URLS.sub("", text)