fixed last_name edge case in replies from a user without one to another with
This commit is contained in:
parent
2faa8b1b4b
commit
5cc36fe5bc
|
@ -87,10 +87,11 @@ getfirst_name(){
|
||||||
|| {
|
|| {
|
||||||
grep "\"language_code\"$" <<< "${first_name}" >/dev/null && utf-16-surrogate-pair-decode "${first_name:14:-17}"
|
grep "\"language_code\"$" <<< "${first_name}" >/dev/null && utf-16-surrogate-pair-decode "${first_name:14:-17}"
|
||||||
} || {
|
} || {
|
||||||
grep "\"last_name\"$" <<< "${first_name}" >/dev/null && utf-16-surrogate-pair-decode "${first_name:14:-13}"
|
grep "\"last_name\"$" <<< "${first_name}" >/dev/null && utf-16-surrogate-pair-decode "${first_name:14:-13}" && return 0
|
||||||
} || {
|
} || {
|
||||||
grep "},\"chat\"$" <<< "${first_name}" >/dev/null && utf-16-surrogate-pair-decode "${first_name:14:-9}"
|
grep "},\"chat\"$" <<< "${first_name}" >/dev/null && utf-16-surrogate-pair-decode "${first_name:14:-9}"
|
||||||
}
|
}
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
getlast_name(){
|
getlast_name(){
|
||||||
|
@ -105,7 +106,7 @@ getlast_name(){
|
||||||
}
|
}
|
||||||
|
|
||||||
getusr_name(){
|
getusr_name(){
|
||||||
local user_name="$(getfirst_name ${1}) $(getlast_name ${1})"
|
local user_name="$({ getfirst_name ${1} && getlast_name ${1}; } | sed ":a;N;$!ba;s/\n/ /")"
|
||||||
[ "${user_name}" != "" ] && printf "%s" "${user_name}"
|
[ "${user_name}" != "" ] && printf "%s" "${user_name}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue