cosmesis
This commit is contained in:
parent
bc3be91376
commit
32076079c6
@ -77,14 +77,6 @@ class Matrix extends Adapter
|
||||
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) ->
|
||||
@client.sendNotice(envelope.room.id, text).catch (err) =>
|
||||
if err.name == 'UnknownDeviceError'
|
||||
@ -95,7 +87,12 @@ class Matrix extends Adapter
|
||||
|
||||
sendImage: (envelope, buffer, info, callback) ->
|
||||
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) =>
|
||||
if err.name == 'UnknownDeviceError'
|
||||
@handleUnknownDevices err
|
||||
@ -107,6 +104,14 @@ class Matrix extends Adapter
|
||||
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...) ->
|
||||
for line in lines
|
||||
@client.sendEmoteMessage(envelope.room.id, line).catch (err) =>
|
||||
|
Loading…
Reference in New Issue
Block a user