diff --git a/interface.c b/interface.c index 16c1f4d..2db33f6 100644 --- a/interface.c +++ b/interface.c @@ -151,6 +151,13 @@ tgl_peer_id_t next_token_user (void) { if (r >= 0) { return tgl_set_peer_id (TGL_PEER_USER, r); } else { return TGL_PEER_NOT_FOUND; } } + if (l >= 8 && !memcmp (s, "user#id", 7)) { + s += 7; + l -= 7; + int r = atoi (s); + if (r >= 0) { return tgl_set_peer_id (TGL_PEER_USER, r); } + else { return TGL_PEER_NOT_FOUND; } + } char c = s[l]; s[l] = 0; @@ -176,6 +183,14 @@ tgl_peer_id_t next_token_chat (void) { if (r >= 0) { return tgl_set_peer_id (TGL_PEER_CHAT, r); } else { return TGL_PEER_NOT_FOUND; } } + + if (l >= 8 && !memcmp (s, "chat#id", 7)) { + s += 7; + l -= 7; + int r = atoi (s); + if (r >= 0) { return tgl_set_peer_id (TGL_PEER_CHAT, r); } + else { return TGL_PEER_NOT_FOUND; } + } char c = s[l]; s[l] = 0;