Made conversations work correctly

This commit is contained in:
Anna
2010-05-18 14:23:17 -04:00
parent 7a5ae9235e
commit c3ac07a693
5 changed files with 50 additions and 33 deletions

View File

@ -159,21 +159,20 @@ class GetConversation(ApiThread):
# Get the root tweet
try:
with self.api.lock:
last_tweet = self.api.GetStatus(self.single_tweet)
last_tweet = self.api.GetStatus(self.root_tweet_id)
statuses.append(last_tweet)
except (HTTPError, URLError):
statuses = None
last_tweet = None
# get tweets in a loop, until there is no in_reply_to_status_id
if last_tweet is not None:
while last_tweet.in_reply_to_status_id is not None:
try:
with self.api.lock:
last_tweet = self.api.GetStatus(self.single_tweet)
statuses.append(last_tweet)
except (HTTPError, URLError):
last_tweet = None
while last_tweet and last_tweet.in_reply_to_status_id:
try:
with self.api.lock:
last_tweet = self.api.GetStatus(last_tweet.in_reply_to_status_id)
statuses.append(last_tweet)
except (HTTPError, URLError):
last_tweet = None
# In case we've never seen some of these users, grab their profile images and cache them
for status in statuses: