mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Create valid account buffers even when session cannot login to the network (works for ignored sessions)
This commit is contained in:
parent
7c80c9d842
commit
fefd88b71c
@ -275,12 +275,7 @@ class Controller(object):
|
||||
self.streams_checker_function.start()
|
||||
|
||||
def create_ignored_session_buffer(self, session):
|
||||
self.accounts.append(session.settings["twitter"]["user_name"])
|
||||
account = buffers.base.AccountBuffer(self.view.nb, session.settings["twitter"]["user_name"], session.settings["twitter"]["user_name"], session.session_id)
|
||||
account.logged = False
|
||||
account.setup_account()
|
||||
self.buffers.append(account)
|
||||
self.view.add_buffer(account.buffer , name=session.settings["twitter"]["user_name"])
|
||||
pub.sendMessage("core.create_account", name=session.get_name(), session_id=session.session_id)
|
||||
|
||||
def login_account(self, session_id):
|
||||
for i in sessions.sessions:
|
||||
@ -291,9 +286,11 @@ class Controller(object):
|
||||
handler.create_buffers(session=session, controller=self, createAccounts=False)
|
||||
self.start_buffers(session)
|
||||
|
||||
def create_account_buffer(self, name, session_id):
|
||||
def create_account_buffer(self, name, session_id, logged=False):
|
||||
self.accounts.append(name)
|
||||
account = buffers.base.AccountBuffer(self.view.nb, name, name, session_id)
|
||||
if logged == False:
|
||||
account.logged = logged
|
||||
account.setup_account()
|
||||
self.buffers.append(account)
|
||||
self.view.add_buffer(account.buffer , name=name)
|
||||
|
@ -15,7 +15,7 @@ class Handler(object):
|
||||
session.get_user_info()
|
||||
name = session.get_name()
|
||||
if createAccounts == True:
|
||||
pub.sendMessage("core.create_account", name=name, session_id=session.session_id)
|
||||
pub.sendMessage("core.create_account", name=name, session_id=session.session_id, logged=True)
|
||||
root_position =controller.view.search(name, name)
|
||||
for i in session.settings['general']['buffer_order']:
|
||||
if i == 'home':
|
||||
|
@ -21,7 +21,7 @@ class Handler(object):
|
||||
session.get_user_info()
|
||||
name = session.get_name()
|
||||
if createAccounts == True:
|
||||
pub.sendMessage("core.create_account", name=name, session_id=session.session_id)
|
||||
pub.sendMessage("core.create_account", name=name, session_id=session.session_id, logged=True)
|
||||
root_position =controller.view.search(name, name)
|
||||
for i in session.settings['general']['buffer_order']:
|
||||
if i == 'home':
|
||||
|
@ -175,5 +175,5 @@ class Session(base.baseSession):
|
||||
def get_name(self):
|
||||
instance = self.settings["mastodon"]["instance"]
|
||||
instance = instance.replace("https://", "")
|
||||
user = self.db["user_name"]
|
||||
user = self.settings["mastodon"]["user_name"]
|
||||
return "Mastodon: {}@{}".format(user, instance)
|
@ -674,4 +674,7 @@ class Session(base.baseSession):
|
||||
pub.sendMessage("sent-dm", data=item, session_name=self.get_name())
|
||||
|
||||
def get_name(self):
|
||||
return "Twitter: {}".format(self.db["user_name"])
|
||||
if self.logged:
|
||||
return "Twitter: {}".format(self.db["user_name"])
|
||||
else:
|
||||
return "Twitter: {}".format(self.settings["twitter"]["user_name"])
|
Loading…
Reference in New Issue
Block a user