From 31f2a85fe944e052e6afe1f18fc581d9246c9846 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Wed, 4 Jan 2023 16:09:34 +0100 Subject: [PATCH] add rewoke token then Access token has expired and send message --- lib/FHEM/Devices/Matrix/Client.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/FHEM/Devices/Matrix/Client.pm b/lib/FHEM/Devices/Matrix/Client.pm index 7b962ff..aed795a 100644 --- a/lib/FHEM/Devices/Matrix/Client.pm +++ b/lib/FHEM/Devices/Matrix/Client.pm @@ -1588,6 +1588,7 @@ sub _PerformHttpRequestOrInternalTimerFAIL { $def = $hash->{helper}->{repeat}->{def}; $value = $hash->{helper}->{repeat}->{value}; $hash->{helper}->{repeat} = undef; + _PerformHttpRequest( $hash, $def, $value ); } else { @@ -1615,6 +1616,18 @@ sub _PerformHttpRequestOrInternalTimerFAIL { \&FHEM::Devices::Matrix::Client::Login, $hash ); } } + elsif ( $hash->{helper}->{softfail} < 3 ) { + if ( $nextRequest eq 'login' ) { + _PerformHttpRequest( $hash, $nextRequest, '' ); + } + elsif ( $nextRequest eq 'sync' && $hash->{helper}->{repeat} ) { + $def = $hash->{helper}->{repeat}->{def}; + $value = $hash->{helper}->{repeat}->{value}; + $hash->{helper}->{repeat} = undef; + + _PerformHttpRequest( $hash, $def, $value ); + } + } return; } -- 2.45.2