cosmesis
This commit is contained in:
parent
bc3be91376
commit
32076079c6
@ -77,14 +77,6 @@ class Matrix extends Adapter
|
|||||||
url: imageURL
|
url: imageURL
|
||||||
|
|
||||||
|
|
||||||
send: (envelope, lines...) ->
|
|
||||||
[..., last] = lines
|
|
||||||
if typeof last is 'function'
|
|
||||||
callback = lines.pop()
|
|
||||||
syn.eachSeries lines, (@handleURL envelope), ->
|
|
||||||
callback() if callback?
|
|
||||||
|
|
||||||
|
|
||||||
sendText: (envelope, text, callback) ->
|
sendText: (envelope, text, callback) ->
|
||||||
@client.sendNotice(envelope.room.id, text).catch (err) =>
|
@client.sendNotice(envelope.room.id, text).catch (err) =>
|
||||||
if err.name == 'UnknownDeviceError'
|
if err.name == 'UnknownDeviceError'
|
||||||
@ -95,7 +87,12 @@ class Matrix extends Adapter
|
|||||||
|
|
||||||
sendImage: (envelope, buffer, info, callback) ->
|
sendImage: (envelope, buffer, info, callback) ->
|
||||||
try
|
try
|
||||||
@client.uploadContent(buffer, name: info.url, type: info.mimetype, rawResponse: false, onlyContentUri: true).done (content_uri) =>
|
@client.uploadContent(buffer,
|
||||||
|
name: info.url
|
||||||
|
type: info.mimetype
|
||||||
|
rawResponse: false
|
||||||
|
onlyContentUri: true
|
||||||
|
).done (content_uri) =>
|
||||||
@client.sendImageMessage(envelope.room.id, content_uri, info, info.url).catch (err) =>
|
@client.sendImageMessage(envelope.room.id, content_uri, info, info.url).catch (err) =>
|
||||||
if err.name == 'UnknownDeviceError'
|
if err.name == 'UnknownDeviceError'
|
||||||
@handleUnknownDevices err
|
@handleUnknownDevices err
|
||||||
@ -107,6 +104,14 @@ class Matrix extends Adapter
|
|||||||
callback() if callback?
|
callback() if callback?
|
||||||
|
|
||||||
|
|
||||||
|
send: (envelope, lines...) ->
|
||||||
|
[..., last] = lines
|
||||||
|
if typeof last is 'function'
|
||||||
|
callback = lines.pop()
|
||||||
|
syn.eachSeries lines, (@handleURL envelope), ->
|
||||||
|
callback() if callback?
|
||||||
|
|
||||||
|
|
||||||
emote: (envelope, lines...) ->
|
emote: (envelope, lines...) ->
|
||||||
for line in lines
|
for line in lines
|
||||||
@client.sendEmoteMessage(envelope.room.id, line).catch (err) =>
|
@client.sendEmoteMessage(envelope.room.id, line).catch (err) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user