vysheng / tg

telegram-cli
GNU General Public License v2.0
6.45k stars 1.52k forks source link

Inaccuracy in README.md #303

Open danielberlin opened 9 years ago

danielberlin commented 9 years ago

I think the following sentence is not accurate: "Peer refers to the name of the contact or dialog and can be accessed by TAB completion. For user contacts peer name is Name Lastname with all spaces changed to underscores. For chats it is it's title with all spaces changed to underscores For encrypted chats it is Name Lastname with all spaces changed to underscores."

Shouldn't it mean "For encrypted chats it is !_Name_Lastname with exclamation mark and underscore as prefix followed by Name and Lastname and all spaces changed to underscores."

Or let me explain differently:

I try to start a new secure chat for a user who is not on my contact list.

add_contact +12345 firstname lastname create_secret_chat firstname_lastname

After this step, I accept the new secret chat on the recipient's side and now try to send a message:

msg firstname_lastname test

  1. The message is sent by a not secret chat.

So how do I call msg here correctly? Something like "msg !_firstname_lastname"?

svenkost commented 9 years ago

The create_secret_chat will return the name of the secret chat. Normally this is !_firstname_lastname for the first secret chat, and after that it will be !_firstname_lastname#1 and so on. So you have to look for the answer of the create_secret_chat to know which username to use. On a port (like with telnet) it will look something like this:

ANSWER 50 Encrypted chat !_Firstname_Lastname#4 is now in wait state

danielberlin commented 9 years ago

Yes, you explained the same like me. Thus I suggest to rewrite the text and make clear where the chat name for secure chat comes from and that the syntax is !_firstname_lastname (reads exclamation mark underscore first underscore lastname)

danielberlin commented 9 years ago

Can README.md be updated to reflect the actual way of sending a message through a secure chat correctly?

smarnv commented 8 years ago

msg <peer> is actually correct since !_firstname_lastname, !_firstname_lastname#3 (if you have many secret chats with one person), or !_user_12345/!_user_12345#3 (when you restart the CLI) is your peer the same way a group chat would be your peer would you want to send a message there with msg. Or has it been actually fixed since you opened this issue?