From ead522dc8a6b340f31daac2a98e7b174ffbb6a83 Mon Sep 17 00:00:00 2001 From: Roman Khafizianov Date: Sun, 26 Apr 2015 19:04:41 +0400 Subject: [PATCH] Peer name parsing inconsistent fix Full peer name with omitted "id" not working in some cases --- lua-tg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua-tg.c b/lua-tg.c index 5fb4afb..454bbd0 100644 --- a/lua-tg.c +++ b/lua-tg.c @@ -1236,6 +1236,12 @@ static int parse_lua_function (lua_State *L, struct lua_function *F) { } else if (sscanf (s, "chat#id%lld", &num) == 1 && num > 0) { tgl_insert_empty_chat (TLS, num); P = tgl_peer_get (TLS, TGL_MK_CHAT (num)); + } else if (sscanf (s, "user#%lld", &num) == 1 && num > 0) { + tgl_insert_empty_user (TLS, num); + P = tgl_peer_get (TLS, TGL_MK_USER (num)); + } else if (sscanf (s, "chat#%lld", &num) == 1 && num > 0) { + tgl_insert_empty_chat (TLS, num); + P = tgl_peer_get (TLS, TGL_MK_CHAT (num)); } else { P = get_peer (s); }