add support for emote and topic setting

This commit is contained in:
Hubert Chathi 2016-09-27 21:33:29 -04:00
parent e0acdabe53
commit 93dcce7fe4

View File

@ -23,10 +23,23 @@ class Matrix extends Adapter
body: str body: str
} }
emote: (envelope, strings...) ->
for str in strings
@client.sendMessage envelope.room, {
msgtype: "m.emote",
body: str
}
reply: (envelope, strings...) -> reply: (envelope, strings...) ->
for str in strings for str in strings
@send envelope, "#{envelope.user.name}: #{str}" @send envelope, "#{envelope.user.name}: #{str}"
topic: (envelope, strings...) ->
for str in strings
@sendEvent envelope.room, "m.room.topic", {
topic: str
}
sendImage: (envelope, url) -> sendImage: (envelope, url) ->
@client.uploadContent(stream: request url, name: url).done (murl) => @client.uploadContent(stream: request url, name: url).done (murl) =>
@client.sendMessage envelope.room, { @client.sendMessage envelope.room, {