diff --git a/README.md b/README.md index ed7d6ff..e701db4 100644 --- a/README.md +++ b/README.md @@ -128,10 +128,8 @@ For sending opus in ogg audio files as voice messages, add a static win32 build #### Set-Up * Create a new account - You can enter an arbitrary username. - It is recommended to use your own internationalized number, followed by `@s.whatsapp.net`. - Example: `123456789` from Germany would use `49123456789@s.whatsapp.net`. - This way, you *recognize yourself in group chats* and Pidgin's logs look sane. + You must enter your phone's internationalized number followed by `@s.whatsapp.net`. + Example: `123456789` from Germany would use `49123456789@s.whatsapp.net`. * Upon login, a QR code is shown in a Pidgin request window. Using your phone's camera, scan the code within 20 seconds – just like you would do with WhatsApp Web. diff --git a/src/c/groups.c b/src/c/groups.c index 81166a2..faadab8 100644 --- a/src/c/groups.c +++ b/src/c/groups.c @@ -219,6 +219,7 @@ gowhatsapp_enter_group_chat(PurpleConnection *pc, const char *remoteJid, char ** // store the JID so it can be retrieved by get_chat_name purple_conversation_set_data(conv, "name", g_strdup(remoteJid)); // MEMCHECK: this leaks, but there is no mechanism to stop it PurpleConvChat *conv_chat = purple_conversation_get_chat_data(conv); + purple_conv_chat_set_nick(conv_chat, purple_account_get_username(account)); if (participants == NULL) { // list of participants is empty, request it explicitly and release it immediately char **participants = gowhatsapp_go_query_group_participants(account, (char *)remoteJid); diff --git a/src/go/handler.go b/src/go/handler.go index 942928d..08aa4ae 100644 --- a/src/go/handler.go +++ b/src/go/handler.go @@ -113,7 +113,9 @@ func (handler *Handler) eventHandler(rawEvt interface{}) { log.Infof("PairSuccess: %#v", evt) log.Infof("client.Store: %#v", cli.Store) if cli.Store.ID == nil { - purple_error(handler.account, fmt.Sprintf("Pairing succeded, but device ID is missing."), ERROR_FATAL) + purple_error(handler.account, "Pairing succeded, but device ID is missing.", ERROR_FATAL) + } else if evt.ID.ToNonAD().String() != handler.username { + purple_error(handler.account, fmt.Sprintf("Your username '%s' does not match the main device's ID '%s'. Please adjust your username.", handler.username, evt.ID.ToNonAD().String()), ERROR_FATAL) } else { set_credentials(handler.account, *cli.Store.ID, cli.Store.RegistrationID) purple_pairing_succeeded(handler.account) diff --git a/src/go/login.go b/src/go/login.go index b2ff109..59b34b6 100644 --- a/src/go/login.go +++ b/src/go/login.go @@ -109,6 +109,8 @@ func login(account *PurpleAccount, purple_user_dir string, username string, cred device = container.NewDevice() // device.RegistrationID has been generated. sync it and continue (see next if below) registrationId = device.RegistrationID + } else if device.ID.ToNonAD().String() != username { + purple_error(account, fmt.Sprintf("Your username '%s' does not match the main device's ID '%s'. Please adjust your username.", username, device.ID.ToNonAD().String()), ERROR_FATAL) } // check user-supplied registration id against the one stored in the device