mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 11:18:08 -06:00
Change: Change the way sessions are named to put the account first, then the social network.
This commit is contained in:
parent
68651ff736
commit
14a956d207
@ -2,6 +2,8 @@ TWBlue Changelog
|
|||||||
|
|
||||||
## changes in this version
|
## changes in this version
|
||||||
|
|
||||||
|
* Core:
|
||||||
|
* The way sessions are named has been changed. Now the account is indicated first, followed by the social network it belongs to.
|
||||||
* Mastodon:
|
* Mastodon:
|
||||||
* fixed an error that caused TWBlue to not display some posts correctly.
|
* fixed an error that caused TWBlue to not display some posts correctly.
|
||||||
* Fixed name for community timelines when created during startup. Now it should be clear if it's a federated or local timeline.
|
* Fixed name for community timelines when created during startup. Now it should be clear if it's a federated or local timeline.
|
||||||
|
@ -3,9 +3,11 @@ from sessions.mastodon import session
|
|||||||
class Session(session.Session):
|
class Session(session.Session):
|
||||||
# disable version check so Mastodon.py won't throw exceptions.
|
# disable version check so Mastodon.py won't throw exceptions.
|
||||||
version_check_mode = "none"
|
version_check_mode = "none"
|
||||||
|
name = "GoToSocial"
|
||||||
|
|
||||||
def get_lists(self):
|
def get_lists(self):
|
||||||
""" Gets the lists that the user is subscribed to and stores them in the database. Returns None."""
|
""" Gets the lists that the user is subscribed to and stores them in the database. Returns None."""
|
||||||
self.db["lists"] = []
|
self.db["lists"] = []
|
||||||
|
|
||||||
def get_muted_users(self):
|
def get_muted_users(self):
|
||||||
self.db["muted_users"] = []
|
self.db["muted_users"] = []
|
||||||
|
@ -23,6 +23,7 @@ MASTODON_VERSION = "4.0.1"
|
|||||||
|
|
||||||
class Session(base.baseSession):
|
class Session(base.baseSession):
|
||||||
version_check_mode = "created"
|
version_check_mode = "created"
|
||||||
|
name = "Mastodon"
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(Session, self).__init__(*args, **kwargs)
|
super(Session, self).__init__(*args, **kwargs)
|
||||||
@ -52,7 +53,7 @@ class Session(base.baseSession):
|
|||||||
log.debug("Logged.")
|
log.debug("Logged.")
|
||||||
self.counter = 0
|
self.counter = 0
|
||||||
except MastodonError:
|
except MastodonError:
|
||||||
log.exception("The login attempt failed.")
|
log.exception(f"The login attempt failed on instance {self.settings['mastodon']['instance']}.")
|
||||||
self.logged = False
|
self.logged = False
|
||||||
else:
|
else:
|
||||||
self.logged = False
|
self.logged = False
|
||||||
@ -241,7 +242,7 @@ class Session(base.baseSession):
|
|||||||
instance = self.settings["mastodon"]["instance"]
|
instance = self.settings["mastodon"]["instance"]
|
||||||
instance = instance.replace("https://", "")
|
instance = instance.replace("https://", "")
|
||||||
user = self.settings["mastodon"]["user_name"]
|
user = self.settings["mastodon"]["user_name"]
|
||||||
return "Mastodon: {}@{}".format(user, instance)
|
return "{}@{} ({})".format(user, instance, self.name)
|
||||||
|
|
||||||
def start_streaming(self):
|
def start_streaming(self):
|
||||||
if self.settings["general"]["disable_streaming"]:
|
if self.settings["general"]["disable_streaming"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user