mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Fixed traceback happened when attempting to send streaming data to not logged sessions
This commit is contained in:
parent
864ebdf96d
commit
7eb2d8930f
@ -108,7 +108,6 @@ class Session(base.baseSession):
|
||||
self.db["sent_direct_messages"] = sent_objects
|
||||
pub.sendMessage("sent-dms-updated", total=sent, account=self.db["user_name"])
|
||||
|
||||
|
||||
return incoming
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@ -515,6 +514,8 @@ class Session(base.baseSession):
|
||||
|
||||
def handle_new_status(self, status, user):
|
||||
""" Handles a new status present in the Streaming API. """
|
||||
if self.logged == False:
|
||||
return
|
||||
# Discard processing the status if the streaming sends a tweet for another account.
|
||||
if self.db["user_name"] != user:
|
||||
return
|
||||
@ -559,5 +560,7 @@ class Session(base.baseSession):
|
||||
self.start_streaming()
|
||||
|
||||
def handle_connected(self, user):
|
||||
if self.logged == False:
|
||||
return
|
||||
if user != self.db["user_name"]:
|
||||
log.debug("Connected streaming endpoint on account {}".format(user))
|
Loading…
Reference in New Issue
Block a user