1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

NOP typing/receipts when a guest

This commit is contained in:
Kegan Dougal
2016-01-07 15:03:37 +00:00
parent cdb4bc5107
commit 8f4bd9c693

View File

@@ -1269,6 +1269,10 @@ MatrixClient.prototype.sendHtmlEmote = function(roomId, body, htmlBody, callback
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.sendReceipt = function(event, receiptType, callback) {
if (this.isGuest()) {
return q({}); // guests cannot send receipts so don't bother.
}
var path = utils.encodeUri("/rooms/$roomId/receipt/$receiptType/$eventId", {
$roomId: event.getRoomId(),
$receiptType: receiptType,
@@ -1332,6 +1336,10 @@ MatrixClient.prototype.getCurrentUploads = function() {
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.sendTyping = function(roomId, isTyping, timeoutMs, callback) {
if (this.isGuest()) {
return q({}); // guests cannot send typing notifications so don't bother.
}
var path = utils.encodeUri("/rooms/$roomId/typing/$userId", {
$roomId: roomId,
$userId: this.credentials.userId