vysheng / tg

telegram-cli
GNU General Public License v2.0
6.48k stars 1.53k forks source link

Adding username to contact sharing #507

Open SyRenity opened 9 years ago

SyRenity commented 9 years ago

I need the username to be present in shared contact, and traced it up to structures.c:

 case CODE_message_media_contact:
    M->type = tgl_message_media_contact;
    M->phone = DS_STR_DUP (DS_MM->phone_number);
    M->first_name = DS_STR_DUP (DS_MM->first_name);
    M->last_name = DS_STR_DUP (DS_MM->last_name);
    M->user_id = DS_LVAL (DS_MM->user_id);
    break;

I can't find any relevant Telegram documentation, any idea if the username is present in shared contact, and how it can be added?

phoudoin commented 9 years ago

Nope, there is not yet an username field in telegram's TL API for message_media_contact objet.

SyRenity commented 9 years ago

@phoudoin So this not supported on the TL protocol level yet? The alternative seems to use user_info with received telegram ID.

phoudoin commented 9 years ago

I fear that the way to do until a new TL layer add a username field to message_media_contact, indeed.