Fix fetching room/user pictures
This commit is contained in:
parent
a14bacc9c1
commit
d7552b43cd
2 changed files with 10 additions and 10 deletions
|
@ -67,7 +67,7 @@ func (a *Account) ezbrMessagef(format string, args ...interface{}) {
|
|||
func (a *Account) Joined(roomId RoomID) {
|
||||
err := a.joinedInternal(roomId)
|
||||
if err != nil {
|
||||
a.ezbrMessagef("Dropping Account.Joined %s: %s", roomId, err)
|
||||
a.ezbrMessagef("Dropping Account.Joined %s: %s", roomId, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ func (a *Account) joinedInternal(roomId RoomID) error {
|
|||
func (a *Account) Left(roomId RoomID) {
|
||||
err := a.leftInternal(roomId)
|
||||
if err != nil {
|
||||
a.ezbrMessagef("Dropping Account.Left %s: %s", roomId, err)
|
||||
a.ezbrMessagef("Dropping Account.Left %s: %s", roomId, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ func (a *Account) leftInternal(roomId RoomID) error {
|
|||
func (a *Account) UserInfoUpdated(user UserID, info *UserInfo) {
|
||||
err := a.userInfoUpdatedInternal(user, info)
|
||||
if err != nil {
|
||||
a.ezbrMessagef("Dropping Account.UserInfoUpdated %s: %s", user, err)
|
||||
a.ezbrMessagef("Dropping Account.UserInfoUpdated %s: %s", user, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ func (a *Account) userInfoUpdatedInternal(user UserID, info *UserInfo) error {
|
|||
func (a *Account) RoomInfoUpdated(roomId RoomID, author UserID, info *RoomInfo) {
|
||||
err := a.roomInfoUpdatedInternal(roomId, author, info)
|
||||
if err != nil {
|
||||
a.ezbrMessagef("Dropping Account.RoomInfoUpdated %s: %s", roomId, err)
|
||||
a.ezbrMessagef("Dropping Account.RoomInfoUpdated %s: %s", roomId, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ func (a *Account) roomInfoUpdatedInternal(roomId RoomID, author UserID, info *Ro
|
|||
func (a *Account) Event(event *Event) {
|
||||
err := a.eventInternal(event)
|
||||
if err != nil {
|
||||
a.ezbrMessagef("Dropping Account.Event %s %s %s: %s", event.Author, event.Recipient, event.Room, err)
|
||||
a.ezbrMessagef("Dropping Account.Event %s %s %s: %s", event.Author, event.Recipient, event.Room, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -321,8 +321,8 @@ func (mm *Mattermost) handleConnected() {
|
|||
t.Team.LastTeamIconUpdate),
|
||||
GetFn: func(o *LazyBlobMediaObject) error {
|
||||
team_img, resp := mm.conn.Client.GetTeamIcon(t.Id, "")
|
||||
if resp.Error == nil {
|
||||
log.Warnf("Could not get team image: %s", resp.Error)
|
||||
if resp.Error != nil {
|
||||
log.Warnf("Could not get team image: %s", resp.Error.Error())
|
||||
return resp.Error
|
||||
}
|
||||
o.ObjectData = team_img
|
||||
|
@ -353,7 +353,7 @@ func (mm *Mattermost) handleConnected() {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
log.Warnf("Could not get channel members: %s", resp.Error)
|
||||
log.Warnf("Could not get channel members: %s", resp.Error.Error())
|
||||
}
|
||||
|
||||
// Read backlog
|
||||
|
@ -411,8 +411,8 @@ func (mm *Mattermost) updateUserInfo(user *model.User) {
|
|||
user.LastPictureUpdate),
|
||||
GetFn: func(o *LazyBlobMediaObject) error {
|
||||
img, resp := mm.conn.Client.GetProfileImage(user.Id, "")
|
||||
if resp.Error == nil {
|
||||
log.Warnf("Could not get profile picture: %s", resp.Error)
|
||||
if resp.Error != nil {
|
||||
log.Warnf("Could not get profile picture: %s", resp.Error.Error())
|
||||
return resp.Error
|
||||
}
|
||||
o.ObjectData = img
|
||||
|
|
Loading…
Reference in a new issue