1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-01 21:21:58 +03:00

Add higher level keys to fake receipts

This commit is contained in:
David Baker
2015-11-09 15:05:46 +00:00
parent ad24596d3f
commit c95b27683f

View File

@@ -13,7 +13,11 @@ var ContentRepo = require("../content-repo");
function synthesizeReceipt(userId, event, receiptType) {
// This is really ugly because JS has no way to express an object literal
// where the name of a key comes from an expression
var fakeReceipt = {content: {}};
var fakeReceipt = {
content: {},
type: "m.receipt",
room_id: event.getRoomId()
};
fakeReceipt.content[event.getId()] = {};
fakeReceipt.content[event.getId()][receiptType] = {};
fakeReceipt.content[event.getId()][receiptType][userId] = {