return username after login

This commit is contained in:
zhaoYangguang 2020-10-20 13:50:08 +08:00
parent 5cea218f42
commit bada7a88d6
1 changed files with 6 additions and 3 deletions

View File

@ -305,8 +305,7 @@ func (user *User) IsConnected() bool {
} }
func (user *User) IsLoginInProgress() bool { func (user *User) IsLoginInProgress() bool {
//return user.Conn != nil && user.Conn.IsLoginInProgress() return user.Conn != nil && user.Conn.IsLoginInProgress()
return false
} }
func (user *User) loginQrChannel(ce *CommandEvent, qrChan <-chan string, eventIDChan chan<- id.EventID) { func (user *User) loginQrChannel(ce *CommandEvent, qrChan <-chan string, eventIDChan chan<- id.EventID) {
@ -371,7 +370,11 @@ func (user *User) Login(ce *CommandEvent, name string, password string) (err err
ce.Reply(err.Error()) ce.Reply(err.Error())
return err return err
} }
ce.Reply("Successfully logged in") username := user.Conn.UserProfile.FirstName
if len(user.Conn.UserProfile.LastName) > 0 {
username = username + user.Conn.UserProfile.LastName
}
ce.Reply("Successfully logged in as @" + username)
user.Conn.Subscribes() // subscribe basic event user.Conn.Subscribes() // subscribe basic event
err = user.Conn.Conn.ContactList(user.Conn.UserProfile.Username) err = user.Conn.Conn.ContactList(user.Conn.UserProfile.Username)