From 59c6b888367bcb3c2d1ba45715c4dc36c664e1aa Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Fri, 13 Nov 2020 00:45:11 +0100 Subject: [PATCH] fix for last message id in mastodon api --- screenless/bureau/publicrelations/publicrelations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screenless/bureau/publicrelations/publicrelations.py b/screenless/bureau/publicrelations/publicrelations.py index cc08e25..b058620 100644 --- a/screenless/bureau/publicrelations/publicrelations.py +++ b/screenless/bureau/publicrelations/publicrelations.py @@ -60,7 +60,7 @@ class PublicRelations(Bureau): to_file=MASTO_CREDS) # TODO: catch the error when our token is too old and throw it out self.masto = Mastodon(client_id=MASTO_CREDS, - api_base_url=masto_server) + api_base_url=masto_server) masto_user = self.config["mastodon"]["user"] masto_pass = self.config["mastodon"]["password"] self.masto.log_in(masto_user, masto_pass) @@ -353,7 +353,7 @@ class PublicRelations(Bureau): # store the last notification id self.last_mast_notif = notifications[0].id with self.dbenv.begin(db=self.tweetdb, write=True) as txn: - txn.put(b"last_mast_notif", self.last_mast_notif.encode()) + txn.put(b"last_mast_notif", self.last_mast_notif) for note in notifications: username = note.account.display_name.encode("cp437", "ignore") + \ b" (" + note.account.acct.encode("cp437", "ignore") + b")"