mirror of
https://github.com/42wim/matterbridge.git
synced 2024-12-19 09:32:35 +01: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)
|
_, err := m.Client.CreateDirectChannel(toUserId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
m.log.Debugf("SendDirectMessage to %#v failed: %s", toUserId, err)
|
m.log.Debugf("SendDirectMessage to %#v failed: %s", toUserId, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
channelName := model.GetDMNameFromIds(toUserId, m.User.Id)
|
channelName := model.GetDMNameFromIds(toUserId, m.User.Id)
|
||||||
|
|
||||||
// update our channels
|
// 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.Lock()
|
||||||
m.Team.Channels = mmchannels.Data.(*model.ChannelList)
|
m.Team.Channels = mmchannels.Data.(*model.ChannelList)
|
||||||
m.Unlock()
|
m.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user