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