mirror of
https://github.com/mautrix/whatsapp.git
synced 2026-05-14 17:56:53 -04:00
Compare commits
1 commit
main
...
fetch-cont
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c29d5632bb |
1 changed files with 9 additions and 0 deletions
|
|
@ -322,6 +322,15 @@ func (wl *WALogin) Wait(ctx context.Context) (*bridgev2.LoginStep, error) {
|
||||||
ul.Client.(*WhatsAppClient).isNewLogin = true
|
ul.Client.(*WhatsAppClient).isNewLogin = true
|
||||||
ul.Client.Connect(ul.Log.WithContext(context.Background()))
|
ul.Client.Connect(ul.Log.WithContext(context.Background()))
|
||||||
|
|
||||||
|
if contact, err := ul.Client.(*WhatsAppClient).GetStore().Contacts.GetContact(wl.LoginSuccess.ID); err != nil {
|
||||||
|
wl.Log.Err(err).Msg("Failed to get own contact after login")
|
||||||
|
} else {
|
||||||
|
contactInfo := ul.Client.(*WhatsAppClient).contactToUserInfo(ctx, wl.LoginSuccess.ID, contact, true)
|
||||||
|
if contactInfo.Name != nil {
|
||||||
|
ul.UserLogin.RemoteProfile.Username = *contactInfo.Name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return &bridgev2.LoginStep{
|
return &bridgev2.LoginStep{
|
||||||
Type: bridgev2.LoginStepTypeComplete,
|
Type: bridgev2.LoginStepTypeComplete,
|
||||||
StepID: LoginStepIDComplete,
|
StepID: LoginStepIDComplete,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue