Fixed reply_id not getting sent to the twitter API

This commit is contained in:
Anna 2010-05-11 18:15:18 -04:00
parent a8abc21dd6
commit 8b56ed2dcf
2 changed files with 5 additions and 3 deletions

View File

@ -170,11 +170,13 @@ class MyTwitter():
def update_status(self):
reply_id = self.reply_id
text = self.update_entry.get_text()
self.update_entry.set_text("")
with self.api.lock:
try:
self.api.PostUpdate(text, in_reply_to_status_id=self.reply_id)
self.api.PostUpdate(text, in_reply_to_status_id=reply_id)
except HTTPError,URLError:
self.update_status_bar('Failed to post tweet')
self.reply_id = None
@ -195,7 +197,7 @@ class MyTwitter():
self.update_count.set_label(new_count)
# If reply_id is set, unset it if we have removed the @ symbol
if self.reply_id is not None and not re.match('@', self.update_entry.get_text()):
if self.reply_id and not re.match('@', self.update_entry.get_text()):
self.reply_id = None

View File

@ -332,7 +332,7 @@ class TweetBox(gtk.VBox):
self.text.set_markup(new_text)
# If this is in reply to something, set appropriate label
if self.in_reply_to_screen_name:
if self.in_reply_to_screen_name and self.in_reply_to_id:
self.reply_to_button.set_label('in reply to ' + self.in_reply_to_screen_name)