mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-22 18:40:25 +00:00
Add more error checking
This commit is contained in:
parent
6e772ee189
commit
e1a5f5bca5
@ -470,11 +470,16 @@ func (m *MMClient) SendDirectMessage(toUserId string, msg string) {
|
||||
_, err := m.Client.CreateDirectChannel(toUserId)
|
||||
if err != nil {
|
||||
m.log.Debugf("SendDirectMessage to %#v failed: %s", toUserId, err)
|
||||
return
|
||||
}
|
||||
channelName := model.GetDMNameFromIds(toUserId, m.User.Id)
|
||||
|
||||
// update our channels
|
||||
mmchannels, _ := m.Client.GetChannels("")
|
||||
mmchannels, err := m.Client.GetChannels("")
|
||||
if err != nil {
|
||||
m.log.Debug("SendDirectMessage: Couldn't update channels")
|
||||
return
|
||||
}
|
||||
m.Lock()
|
||||
m.Team.Channels = mmchannels.Data.(*model.ChannelList)
|
||||
m.Unlock()
|
||||
|
Loading…
Reference in New Issue
Block a user