Skip to content

Commit ead522d

Browse files
committed
Peer name parsing inconsistent fix
Full peer name with omitted "id" not working in some cases
1 parent 5da1506 commit ead522d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎lua-tg.c

+6
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,12 @@ static int parse_lua_function (lua_State *L, struct lua_function *F) {
12361236
} else if (sscanf (s, "chat#id%lld", &num) == 1 && num > 0) {
12371237
tgl_insert_empty_chat (TLS, num);
12381238
P = tgl_peer_get (TLS, TGL_MK_CHAT (num));
1239+
} else if (sscanf (s, "user#%lld", &num) == 1 && num > 0) {
1240+
tgl_insert_empty_user (TLS, num);
1241+
P = tgl_peer_get (TLS, TGL_MK_USER (num));
1242+
} else if (sscanf (s, "chat#%lld", &num) == 1 && num > 0) {
1243+
tgl_insert_empty_chat (TLS, num);
1244+
P = tgl_peer_get (TLS, TGL_MK_CHAT (num));
12391245
} else {
12401246
P = get_peer (s);
12411247
}

0 commit comments

Comments
 (0)