Added a pubsub event to create sessions buffers

This commit is contained in:
2021-08-30 10:51:26 -05:00
parent 7c34204d17
commit 65512a9862
3 changed files with 55 additions and 78 deletions

View File

@@ -45,6 +45,8 @@ class baseSession(object):
self.db={}
# Config specification file.
self.config_spec = "conf.defaults"
# Session type.
self.type = "base"
@property
def is_logged(self):

View File

@@ -124,6 +124,7 @@ class Session(base.baseSession):
# This will be especially useful because if the user reactivates their account later, TWblue will try to retrieve such user again at startup.
# If we wouldn't implement this approach, TWBlue would save permanently the "deleted user" object.
self.deleted_users = {}
self.type = "twitter"
pub.subscribe(self.handle_new_status, "newStatus")
pub.subscribe(self.handle_connected, "streamConnected")