2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-06 12:18:46 +00:00

MQTT2_SERVER: ignoreRegexp prevents now retain and publish (Forum #130511)

git-svn-id: https://svn.fhem.de/fhem/trunk@26745 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2022-11-25 08:52:44 +00:00
parent fc4bcba00e
commit 02d72fd349

View File

@ -541,6 +541,10 @@ MQTT2_SERVER_doPublish($$$$;$)
$src = $server if(!defined($src));
my $now = gettimeofday();
my $serverName = $server->{NAME};
my $ir = AttrVal($serverName, "ignoreRegexp", undef);
return if(defined($ir) && "$tp:$val" =~ m/$ir/);
if($retain) {
if(!defined($val) || $val eq "") {
delete($server->{retain}{$tp});
@ -561,10 +565,6 @@ MQTT2_SERVER_doPublish($$$$;$)
MQTT2_SERVER_sendto($server, $defs{$clName}, $tp, $val);
}
my $serverName = $server->{NAME};
my $ir = AttrVal($serverName, "ignoreRegexp", undef);
return if(defined($ir) && "$tp:$val" =~ m/$ir/);
my $cid = $src->{cid};
$tp =~ s/:/_/g if(AttrVal($serverName, "topicConversion", 1)); # 96608
if(defined($cid) || # "real" MQTT client
@ -873,7 +873,10 @@ MQTT2_SERVER_ReadDebug($$)
<a id="MQTT2_SERVER-attr-ignoreRegexp"></a>
<li>ignoreRegexp<br>
if $topic:$message matches ignoreRegexp, then it will be silently ignored.
if $topic:$message matches ignoreRegexp, then it will be silently
ignored. Such messages are not distributed to connected MQTT clients,
are not stored (if retain is set), and are not dispatched in FHEM for
further processing.
</li>
<a id="MQTT2_SERVER-attr-keepaliveFactor"></a>