diff --git a/fhem/CHANGED b/fhem/CHANGED index 05e5efdad..0f58a01cb 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 49_TBot_List: configure confirm delete as attribute confirmDelete - changed: 98_fheminfo.pm: remove release, featurelevel, uptime infos - added: 98_uptime.pm: new command module to show FHEM uptime - change: 93_DbLog: V2.19.0, replace internal DBMODEL by MODEL completely diff --git a/fhem/FHEM/49_TBot_List.pm b/fhem/FHEM/49_TBot_List.pm index 229ca89ce..b383feef0 100644 --- a/fhem/FHEM/49_TBot_List.pm +++ b/fhem/FHEM/49_TBot_List.pm @@ -68,18 +68,19 @@ # Menu für gesamte Liste # Sortierung A-Z und Z-A für Liste # allow double entries and correct handling -# 0.3 2017-05-13 Menu / Sort und fixes +# 0.4 2017-05-13 Menu / Sort und fixes # changed query data to prefix TBL_ # fhem-call get peerId is quiet +# 0.5 2017-05-13 Menu / Sort und fixes # +# confirm delete configurable as attribute confirmDelete # # ############################################################################## # TASKS # # -# # Make texts and addtl buttons configurable # # internal value if waiting for msg or reply -- otherwise notify not looping through events @@ -143,6 +144,7 @@ sub TBot_List_Initialize($) { "telegramBots:textField ". "optionDouble:0,1 ". "handleUnsolicited:0,1 ". + "confirmDelete:0,1 ". "allowedPeers:textField ". $readingFnAttributes; } @@ -405,6 +407,9 @@ sub TBot_List_Attr(@) { if ( ($aName eq 'optionDouble') ) { $aVal = ($aVal eq "1")? "1": "0"; + } elsif ( ($aName eq "confirmDelete" ) ) { + $aVal = ($aVal eq "1")? "1": "0"; + } elsif ($aName eq 'allowedPeers') { return "\"TBot_List_Attr: \" $aName needs to be given in digits - and space only" if ( $aVal !~ /^[[:digit:] -]*$/ ); @@ -850,9 +855,11 @@ sub TBot_List_handler($$$$;$) if ( defined($msgId ) ) { # show ask for removal my $textmsg = "Liste ".$lname."\nEintrag ".($no+1)." (".$list[$no].") ?"; - # show ask msg - my $inline = "(".TBot_List_inlinekey( $hash, "Entfernen", "list_rem-$no" )."|".TBot_List_inlinekey( $hash, "Aendern", "list_askchg-$no" )."|". - TBot_List_inlinekey( $hash, "Nach Oben", "list_totop-$no" )."|".TBot_List_inlinekey( $hash, "Zurueck", "list_edit" ).")"; + # show ask msgs (depending on attr) + my $indata = ( AttrVal($name,'confirmDelete',1) ? "list_rem-$no" : "list_remyes-$no" ); + my $inline = "(".TBot_List_inlinekey( $hash, "Entfernen", $indata )."|". + TBot_List_inlinekey( $hash, "Aendern", "list_askchg-$no" )."|". + TBot_List_inlinekey( $hash, "Nach Oben", "list_totop-$no" )."|".TBot_List_inlinekey( $hash, "Zurueck", "list_edit" ).")"; fhem( "set ".$tbot." queryEditInline $msgId ".'@'.$chatId." $inline $textmsg" ); } else { $ret = "TBot_List_handler: $name - $tbot ERROR no msgId known for peer :$peer: chat :$chatId: cmd :$cmd: ".(defined($arg)?"arg :$arg:":""); @@ -1350,6 +1357,9 @@ sub TBot_List_Setup($) {
handleUnsolicited <1 or 0>
confirmDelete <1 or 0>