1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Merge pull request #590 from matrix-org/rxl881/stickers

Add event type for stickers [WIP]
This commit is contained in:
Richard Lewis
2018-01-09 14:49:05 +00:00
committed by GitHub
2 changed files with 30 additions and 3 deletions

View File

@@ -1321,6 +1321,32 @@ MatrixClient.prototype.sendImageMessage = function(roomId, url, info, text, call
return this.sendMessage(roomId, content, callback);
};
/**
* @param {string} roomId
* @param {string} url
* @param {Object} info
* @param {string} text
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.sendStickerMessage = function(roomId, url, info, text, callback) {
if (utils.isFunction(text)) {
callback = text; text = undefined;
}
if (!text) {
text = "Sticker";
}
const content = {
url: url,
info: info,
body: text,
};
return this.sendEvent(
roomId, "m.room.sticker", content, callback, undefined,
);
};
/**
* @param {string} roomId
* @param {string} body