mirror of
https://github.com/caronc/apprise.git
synced 2024-12-04 14:04:48 +01:00
Matrix Long Lived Token: Don't logout, and use UUIDv4 for transactionIds (#1249)
This commit is contained in:
parent
9e301df438
commit
c49e2127c2
@ -32,6 +32,7 @@
|
||||
#
|
||||
import re
|
||||
import requests
|
||||
import uuid
|
||||
from markdown import markdown
|
||||
from json import dumps
|
||||
from json import loads
|
||||
@ -616,6 +617,7 @@ class NotifyMatrix(NotifyBase):
|
||||
|
||||
if self.access_token is None and self.password and not self.user:
|
||||
self.access_token = self.password
|
||||
self.transaction_id = uuid.uuid4()
|
||||
|
||||
if self.access_token is None:
|
||||
# We need to register
|
||||
@ -746,7 +748,8 @@ class NotifyMatrix(NotifyBase):
|
||||
|
||||
# Increment the transaction ID to avoid future messages being
|
||||
# recognized as retransmissions and ignored
|
||||
if self.version == MatrixVersion.V3:
|
||||
if self.version == MatrixVersion.V3 \
|
||||
and self.access_token != self.password:
|
||||
self.transaction_id += 1
|
||||
self.store.set(
|
||||
'transaction_id', self.transaction_id,
|
||||
@ -1401,6 +1404,10 @@ class NotifyMatrix(NotifyBase):
|
||||
# re-use our credentials with
|
||||
return
|
||||
|
||||
if self.access_token is not None \
|
||||
and self.access_token == self.password and not self.user:
|
||||
return
|
||||
|
||||
try:
|
||||
self._logout()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user