fix set CHAT[ID] to new id on chat migration

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-01-23 13:58:45 +01:00
parent 41e956d517
commit 78e4551107

View File

@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb
# 8 - curl/wget missing # 8 - curl/wget missing
# 10 - not bash! # 10 - not bash!
# #
#### $$VERSION$$ v1.32-dev-10-g121f131 #### $$VERSION$$ v1.32-dev-11-g41e956d
################################################################## ##################################################################
# emmbeded system may claim bash but it is not # emmbeded system may claim bash but it is not
@ -982,6 +982,8 @@ process_message() {
if [ -n "${UPD["result,${num},message,migrate_to_chat_id"]}" ]; then if [ -n "${UPD["result,${num},message,migrate_to_chat_id"]}" ]; then
MIGRATE[TO]="${UPD["result,${num},message,migrate_to_chat_id"]}" MIGRATE[TO]="${UPD["result,${num},message,migrate_to_chat_id"]}"
MIGRATE[FROM]="${UPD["result,${num},message,migrate_from_chat_id"]}" MIGRATE[FROM]="${UPD["result,${num},message,migrate_from_chat_id"]}"
# CHAT is already migrated, so set new chat id
[ "${CHAT[ID]}" = "${MIGRATE[FROM]}" ] && CHAT[ID]="${MIGRATE[FROM]}"
SERVICE[MIGRATE]="${MIGRATE[FROM]} ${MIGRATE[TO]}" SERVICE[MIGRATE]="${MIGRATE[FROM]} ${MIGRATE[TO]}"
[ -z "${MESSAGE[0]}" ] &&\ [ -z "${MESSAGE[0]}" ] &&\
MESSAGE[0]="/_migrate_group ${SERVICE[MIGRATE]}" MESSAGE[0]="/_migrate_group ${SERVICE[MIGRATE]}"