5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 12:50:27 +00:00

Add more error checking

This commit is contained in:
Wim 2017-02-03 16:43:21 +01:00
parent 6e772ee189
commit e1a5f5bca5

View File

@ -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()