User's own tweets shouldn't be flagged as new (although we'll still color them unread)

This commit is contained in:
Anna 2010-05-28 18:44:58 -04:00
parent 5e25d4afcf
commit dce0fa160c
2 changed files with 11 additions and 3 deletions

View File

@ -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)

View File

@ -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: