diff options
author | Wim <wim@42.be> | 2017-09-04 14:24:22 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-09-04 14:24:22 +0200 |
commit | dd985d1dad22f872cd1f9963d54701c24310ddcc (patch) | |
tree | b91dfe499200fb695df5c68727b91d85e0d48bc5 /matterclient | |
parent | d2caea70a2761064d937fd836a54d75a12bf73b8 (diff) | |
download | matterbridge-msglm-dd985d1dad22f872cd1f9963d54701c24310ddcc.tar.gz matterbridge-msglm-dd985d1dad22f872cd1f9963d54701c24310ddcc.tar.bz2 matterbridge-msglm-dd985d1dad22f872cd1f9963d54701c24310ddcc.zip |
Fix sending direct messages with APIv4
Diffstat (limited to 'matterclient')
-rw-r--r-- | matterclient/matterclient.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index fb91d0ba..f2aa44d9 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -600,9 +600,9 @@ func (m *MMClient) createCookieJar(token string) *cookiejar.Jar { func (m *MMClient) SendDirectMessage(toUserId string, msg string) { m.log.Debugf("SendDirectMessage to %s, msg %s", toUserId, msg) // create DM channel (only happens on first message) - _, err := m.Client.CreateDirectChannel(m.User.Id, toUserId) - if err != nil { - m.log.Debugf("SendDirectMessage to %#v failed: %s", toUserId, err) + _, resp := m.Client.CreateDirectChannel(m.User.Id, toUserId) + if resp.Error != nil { + m.log.Debugf("SendDirectMessage to %#v failed: %s", toUserId, resp.Error) return } channelName := model.GetDMNameFromIds(toUserId, m.User.Id) |