2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-22 02:10:32 +00:00

75_MSG.pm: improvement in combination with use of RESIDENTS readings like residentsTotalRoommatesPresentDevs as source for recipients. Ignores messages with recipients containing just ,-:| w/o explicit warning

git-svn-id: https://svn.fhem.de/fhem/trunk@11891 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2016-08-04 16:59:47 +00:00
parent 4a600cbf69
commit e0bc98b4e2

View File

@ -134,6 +134,18 @@ s/^[\s\t]*([a-z,]*!?(screen|light|audio|text|push|mail)[a-z,!|]*)[\s\t]+//
$types = $1;
}
# programatic exception:
# e.g. recipients were given automatically from empty readings
if ( $msg =~ s/^[\s\t]*([!]?(([A-Za-z0-9%+._-])*@([,\-:|]+)))[\s\t]+// ) {
Log3 $globalDevName, 4,
"msg: recipient '$1' contains special characters like"
. " ',-:|' so message won't be sent. This might be okay, e.g. if you are"
. " using something like a reading from RESIDENTS/ROOMMATE/GUEST to"
. " address present or absent residents and this list is simply empty"
. " at this time. ($msg)";
return;
}
# check for given recipients
if ( $msg =~
s/^[\s\t]*([!]?(([A-Za-z0-9%+._-])*@([%+a-z0-9A-Z.-]+))[\w,@.!|:]*)[\s\t]+//