diff --git a/hrafn.py b/hrafn.py index 1ce6262..8007b2d 100755 --- a/hrafn.py +++ b/hrafn.py @@ -328,7 +328,7 @@ class Hrafn(): if single_tweet and not conversation: entries=1 - new_pane = TweetPane(name, num_entries=entries, single_tweet=single_tweet, is_user=is_user, conversation=conversation) + new_pane = TweetPane(name, username=self.username, num_entries=entries, single_tweet=single_tweet, is_user=is_user, conversation=conversation) new_pane.connect('new-tweets', self.on_read_tweets_changed) new_pane.connect('tweets-read', self.on_read_tweets_changed) diff --git a/twitterwidgets.py b/twitterwidgets.py index 9b6aaa6..0caa9da 100644 --- a/twitterwidgets.py +++ b/twitterwidgets.py @@ -17,9 +17,16 @@ class TweetPane(gtk.ScrolledWindow): It also gets some data from its parent, including num_entries ''' - def __init__(self, list_name, num_entries=20, single_tweet=None, is_user=False, conversation=False): + def __init__(self, list_name, username, num_entries=20, single_tweet=None, is_user=False, conversation=False): gtk.ScrolledWindow.__init__(self) + # 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) + else: + self.username = username + self.list_name = list_name self.single_tweet = single_tweet self.conversation = conversation @@ -115,8 +122,9 @@ class TweetPane(gtk.ScrolledWindow): read = True if i < len(statuses): if statuses[i].id > self.last_tweet_read: - self.num_new_tweets += 1 read = False + if statuses[i].user.screen_name != self.username: + self.num_new_tweets += 1 self.tweets[i].set_status(statuses[i], read) self.tweets[i].show() else: