From 97bfa253e24222fc2fe7202bf1511f6fadc18b73 Mon Sep 17 00:00:00 2001 From: vvaltman Date: Thu, 18 Jun 2015 15:54:55 +0300 Subject: [PATCH] updated tgl. Fixed contact_search. Added resolve_username --- CHANGELOG | 2 ++ interface.c | 9 +++++---- tgl | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2e90ba1..4ee66d0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ 1.3.3 * support for sending custom keyboard +* fixed contact_search +* TGL-2.0.3 1.3.2 * use TGL-2.0.2 * add block/unblock user methods diff --git a/interface.c b/interface.c index 40ec9b2..8bec484 100644 --- a/interface.c +++ b/interface.c @@ -1169,10 +1169,10 @@ void do_dialog_list (struct command *command, int arg_num, struct arg args[], st tgl_do_get_dialog_list (TLS, args[0].num != NOT_FOUND ? args[0].num : 100, args[1].num != NOT_FOUND ? args[1].num : 0, print_dialog_list_gw, ev); } -void do_contact_search (struct command *command, int arg_num, struct arg args[], struct in_ev *ev) { - assert (arg_num == 2); +void do_resolve_username (struct command *command, int arg_num, struct arg args[], struct in_ev *ev) { + assert (arg_num == 1); if (ev) { ev->refcnt ++; } - tgl_do_contact_search (TLS, args[0].str, strlen (args[0].str), args[1].num == NOT_FOUND ? args[1].num : 10, print_user_list_gw, ev); + tgl_do_contact_search (TLS, args[0].str, strlen (args[0].str), print_user_gw, ev); } void do_contact_list (struct command *command, int arg_num, struct arg args[], struct in_ev *ev) { @@ -1388,7 +1388,7 @@ struct command commands[MAX_COMMANDS_SIZE] = { {"chat_with_peer", {ca_peer, ca_none}, do_chat_with_peer, "chat_with_peer \tInterface option. All input will be treated as messages to this peer. Type /quit to end this mode", NULL}, {"clear", {ca_none}, do_clear, "clear\tClears all data and exits. For debug.", NULL}, {"contact_list", {ca_none}, do_contact_list, "contact_list\tPrints contact list", NULL}, - {"contact_search", {ca_string, ca_number | ca_optional, ca_none}, do_contact_search, "contact_search username [limit]\tSearches contacts by username", NULL}, + {"contact_search", {ca_string, ca_none}, do_resolve_username, "contact_search username\tSearches user by username", NULL}, {"create_group_chat", {ca_string, ca_user, ca_period, ca_none}, do_create_group_chat, "create_group_chat +\tCreates group chat with users", NULL}, {"create_secret_chat", {ca_user, ca_none}, do_create_secret_chat, "create_secret_chat \tStarts creation of secret chat", NULL}, {"del_contact", {ca_user, ca_none}, do_del_contact, "del_contact \tDeletes contact from contact list", NULL}, @@ -1430,6 +1430,7 @@ struct command commands[MAX_COMMANDS_SIZE] = { {"reply_photo", {ca_number, ca_file_name, ca_string_end | ca_optional, ca_none}, do_reply_photo, "reply_photo [caption]\tSends photo to peer", NULL}, //{"reply_text", {ca_number, ca_file_name_end, ca_none}, do_reply_text, "reply_text \tSends contents of text file as plain text message", NULL}, {"reply_video", {ca_number, ca_file_name, ca_none}, do_reply_video, "reply_video \tSends video to peer", NULL}, + {"resolve_username", {ca_string, ca_none}, do_resolve_username, "resolve_username username\tSearches user by username", NULL}, //{"restore_msg", {ca_number, ca_none}, do_restore_msg, "restore_msg \tRestores message. Only available shortly (one hour?) after deletion", NULL}, {"safe_quit", {ca_none}, do_safe_quit, "safe_quit\tWaits for all queries to end, then quits", NULL}, {"search", {ca_peer | ca_optional, ca_number | ca_optional, ca_number | ca_optional, ca_number | ca_optional, ca_number | ca_optional, ca_string_end}, do_search, "search [peer] [limit] [from] [to] [offset] pattern\tSearch for pattern in messages from date from to date to (unixtime) in messages with peer (if peer not present, in all messages)", NULL}, diff --git a/tgl b/tgl index d976963..638b26d 160000 --- a/tgl +++ b/tgl @@ -1 +1 @@ -Subproject commit d9769636bcd5d2b209c956e15eca4a81f9e677e9 +Subproject commit 638b26d60455b82c55b96dfe2043108c52e50952