Fixed bug that makes list to crash the client

This commit is contained in:
Manuel Cortez 2017-01-21 16:50:17 -06:00
parent 6baf417d35
commit 3684ec2783
2 changed files with 9 additions and 9 deletions

View File

@ -713,11 +713,11 @@ class listBufferController(baseBufferController):
super(listBufferController, self).start_stream(mandatory) super(listBufferController, self).start_stream(mandatory)
def get_user_ids(self): def get_user_ids(self):
self.users = []
next_cursor = -1 next_cursor = -1
while(next_cursor): while(next_cursor):
users = self.session.twitter.twitter.get_list_members(list_id=self.list_id, cursor=next_cursor, include_entities=False, skip_status=True) users = self.session.twitter.twitter.get_list_members(list_id=self.list_id, cursor=next_cursor, include_entities=False, skip_status=True)
for i in users['users']: for i in users['users']:
if i["id"] not in self.users:
self.users.append(i["id"]) self.users.append(i["id"])
next_cursor = users["next_cursor"] next_cursor = users["next_cursor"]

View File

@ -27,12 +27,12 @@ class timelinesStreamer(TwythonStreamer):
if utils.find_item(data["id"], self.session.db["%s-timeline" % (i,)]) != None: if utils.find_item(data["id"], self.session.db["%s-timeline" % (i,)]) != None:
log.error("duplicated tweet. Ignoring it...") log.error("duplicated tweet. Ignoring it...")
return return
try: # try:
data_ = self.session.check_quoted_status(data) data_ = self.session.check_quoted_status(data)
data_ = self.session.check_long_tweet(data_) data_ = self.session.check_long_tweet(data_)
data = data_ data = data_
except ValueError: # except ValueError:
pass # pass
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s-timeline" % (i,)].append(data) if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s-timeline" % (i,)].append(data)
else: self.session.db["%s-timeline" % (i,)].insert(0, data) else: self.session.db["%s-timeline" % (i,)].insert(0, data)
pub.sendMessage("item-in-timeline", data= data, user= self.session.db["user_name"], who= i) pub.sendMessage("item-in-timeline", data= data, user= self.session.db["user_name"], who= i)
@ -53,7 +53,7 @@ class timelinesStreamer(TwythonStreamer):
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s" % (i.name,)].append(data) if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s" % (i.name,)].append(data)
else: self.session.db["%s" % (i.name,)].insert(0, data) else: self.session.db["%s" % (i.name,)].insert(0, data)
pub.sendMessage("item-in-list", data=data, user=self.session.db["user_name"], where=i.name) pub.sendMessage("item-in-list", data=data, user=self.session.db["user_name"], where=i.name)
except NameError: except ValueError:
pass pass
def set_friends(self, friends): def set_friends(self, friends):