Fixed regex so that we should get the username in TweetPane, so new tweets won't increment the unread count if they are from the user herself

This commit is contained in:
Anna 2010-05-29 01:16:06 -04:00
parent 5eaf159865
commit 3e411e6e1d
2 changed files with 2 additions and 3 deletions

1
TODO
View File

@ -17,4 +17,3 @@ bugs:
* "ValueError: list.remove(x): x not in list" when trying to close a tab (error recurred after adding conversation support). Tabs can be reordered, then closed, as a workaround.
* Links must be right-clicked on to activate - can't left-click on the link directly. This seems to be a pygtk issue
* Sometimes tweets are posted when we display 'failed to post tweet'... need to differentiate between kinds of errors... or something.
* Some posts by the user are still being counted as unread when they show up...

View File

@ -23,7 +23,7 @@ class TweetPane(gtk.ScrolledWindow):
# If the username is encoded in the tweet pane's name, we really want
# to use it instead, since it may not match the current api's name
if re.search(r'(^| ).*/', list_name):
self.username = re.sub(r'(list: | )(.*?)/.*$', r'\2', list_name)
self.username = re.sub(r'(list: | )?(.*?)/.*$', r'\2', list_name)
else:
self.username = username
@ -471,7 +471,7 @@ class TweetBox(gtk.HBox):
new_text = re.sub(r'"([^;]*?)( |$)', r'"\1\2', new_text)
if gtk.gtk_version[0] > 2 or (gtk.gtk_version[0] == 2 and gtk.gtk_version[1] >= 18):
# Make URLs into links
new_text = re.sub(r"(http://.*?)([^0-9a-zA-Z.~/-_]|$)", r'<a href="\1">\1</a>\2', new_text)
new_text = re.sub(r"(http://.*?)([^0-9a-zA-Z.~/_-]|$)", r'<a href="\1">\1</a>\2', new_text)
# Make @ or # refs into links, to be used internally
new_text = re.sub(r'@(.*?)([^0-9a-zA-Z_]|$)', self._make_user_link, new_text)
new_text = re.sub(r'#(.*?)([^0-9a-zA-Z_-]|$)', self._make_hashtag_link, new_text)