mirror of
https://github.com/42wim/matterbridge.git
synced 2024-12-19 09:32:35 +01:00
Fix sending direct messages with APIv4
This commit is contained in:
parent
d2caea70a2
commit
dd985d1dad
@ -600,9 +600,9 @@ func (m *MMClient) createCookieJar(token string) *cookiejar.Jar {
|
|||||||
func (m *MMClient) SendDirectMessage(toUserId string, msg string) {
|
func (m *MMClient) SendDirectMessage(toUserId string, msg string) {
|
||||||
m.log.Debugf("SendDirectMessage to %s, msg %s", toUserId, msg)
|
m.log.Debugf("SendDirectMessage to %s, msg %s", toUserId, msg)
|
||||||
// create DM channel (only happens on first message)
|
// create DM channel (only happens on first message)
|
||||||
_, err := m.Client.CreateDirectChannel(m.User.Id, toUserId)
|
_, resp := m.Client.CreateDirectChannel(m.User.Id, toUserId)
|
||||||
if err != nil {
|
if resp.Error != nil {
|
||||||
m.log.Debugf("SendDirectMessage to %#v failed: %s", toUserId, err)
|
m.log.Debugf("SendDirectMessage to %#v failed: %s", toUserId, resp.Error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
channelName := model.GetDMNameFromIds(toUserId, m.User.Id)
|
channelName := model.GetDMNameFromIds(toUserId, m.User.Id)
|
||||||
|
Loading…
Reference in New Issue
Block a user