make user_is_creator more failsave

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-04-11 20:54:26 +02:00
parent 307363a4cc
commit 88cf2d9265

View File

@ -10,7 +10,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ v0.6-dev2-10-gdb64978
#### $$VERSION$$ v0.6-dev2-12-g307363a
#
# Exit Codes:
# - 0 sucess (hopefully)
@ -224,7 +224,7 @@ leave_chat() {
}
user_is_creator() {
if [ "$1" == "$2" ] || [ "$(get_chat_member_status "$1" "$2")" == "creator" ]; then return 0; fi
if [ "${1:--}" == "${2:-+}" ] || [ "$(get_chat_member_status "$1" "$2")" == "creator" ]; then return 0; fi
return 1
}