50_TelegramBot: fix: options remove in sendit corrected: #msg641797

git-svn-id: https://svn.fhem.de/fhem/trunk@14424 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
viegener
2017-05-30 18:11:30 +00:00
parent 98b63c9baa
commit de7b0cd8c8

View File

@@ -111,6 +111,12 @@
# Debug/log cleanup
# 2.4 2016-05-25 favorites rework - inline / allow : in inline
# fix: options remove in sendit corrected: #msg641797
#
#
#
#
#
##############################################################################
@@ -812,6 +818,18 @@ sub TelegramBot_Attr(@) {
# wait some time before next polling is starting
TelegramBot_ResetPolling( $hash );
} elsif ($aName eq 'disable') {
if ( $aVal =~ /^(1|0)$/ ) {
# let all existing methods run into block
RemoveInternalTimer($hash);
$hash->{POLLING} = -1;
# wait some time before next polling is starting
TelegramBot_ResetPolling( $hash );
} else {
return "\"TelegramBot_Attr: \" $aName needs to be 1 or 0";
}
} elsif ($aName eq 'pollingVerbose') {
return "\"TelegramBot_Attr: \" Incorrect value given for pollingVerbose" if ( $aVal !~ /^((1_Digest)|(2_Log)|(0_None))$/ );
@@ -829,6 +847,15 @@ sub TelegramBot_Attr(@) {
$_[3] = $aVal;
} elsif ($cmd eq "set") {
if ( ($aName eq 'pollingTimeout') || ($aName eq 'disable') ) {
# let all existing methods run into block
RemoveInternalTimer($hash);
$hash->{POLLING} = -1;
# wait some time before next polling is starting
TelegramBot_ResetPolling( $hash );
}
}
return undef;
@@ -1562,7 +1589,8 @@ sub TelegramBot_SendIt($$$$$;$$$)
if ( defined( $peers ) ) {
# ignore return, since it is only queued
# remove msgid from options and also replyid reset
my $sepoptions =~ s/-msgid-//;
my $sepoptions = $options;
$sepoptions =~ s/-msgid-//;
TelegramBot_SendIt( $hash, $peers, $msg, $addPar, $isMedia, undef, $sepoptions );
}