Skip to content

Commit e8c16c6

Browse files
committed
Merge pull request #617 from Floens/get_self
Add get_self command
2 parents 0faf9f8 + aee4b24 commit e8c16c6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ If two or more peers have same name, <sharp>number is appended to the name. (for
192192
* **stats** - just for debugging
193193
* **show_license** - prints contents of GPLv2
194194
* **help** - prints this help
195+
* **get_self** - get our user info
195196

196197
#### Card
197198
* **export_card** - print your 'card' that anyone can later use to import your contact

‎interface.c

+6
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,11 @@ void do_broadcast (struct command *command, int arg_num, struct arg args[], stru
881881

882882
/* {{{ EDITING SELF PROFILE */
883883

884+
void do_get_self(struct command *command, int arg_num, struct arg args[], struct in_ev *ev) {
885+
if (ev) { ev->refcnt ++; }
886+
tgl_do_get_user_info (TLS, TGL_MK_USER(TLS->our_id), 0, print_user_info_gw, ev);
887+
}
888+
884889
void do_set_profile_photo (struct command *command, int arg_num, struct arg args[], struct in_ev *ev) {
885890
assert (arg_num == 1);
886891
if (ev) { ev->refcnt ++; }
@@ -1369,6 +1374,7 @@ struct command commands[MAX_COMMANDS_SIZE] = {
13691374
{"fwd", {ca_peer, ca_number, ca_period, ca_none}, do_fwd, "fwd <peer> <msg-id>+\tForwards message to peer. Forward to secret chats is forbidden", NULL},
13701375
{"fwd_media", {ca_peer, ca_number, ca_none}, do_fwd_media, "fwd_media <peer> <msg-id>\tForwards message media to peer. Forward to secret chats is forbidden. Result slightly differs from fwd", NULL},
13711376
{"get_message", {ca_number, ca_none}, do_get_message, "get_message <msg-id>\tGet message by id", NULL},
1377+
{"get_self", {ca_none}, do_get_self, "get_self \tGet our user info", NULL},
13721378
{"help", {ca_none}, do_help, "help\tPrints this help", NULL},
13731379
{"history", {ca_peer, ca_number | ca_optional, ca_number | ca_optional, ca_none}, do_history, "history <peer> [limit] [offset]\tPrints messages with this peer (most recent message lower). Also marks messages as read", NULL},
13741380
{"import_card", {ca_string, ca_none}, do_import_card, "import_card <card>\tGets user by card and prints it name. You can then send messages to him as usual", NULL},

0 commit comments

Comments
��(0)