@@ -178,7 +178,7 @@ describe("<SendMessageComposer/>", () => {
178
178
const content : IContent = { } ;
179
179
attachMentions ( "@alice:test" , content , model , undefined ) ;
180
180
expect ( content ) . toEqual ( {
181
- "org.matrix.msc3952 .mentions" : { } ,
181
+ "m .mentions" : { } ,
182
182
} ) ;
183
183
} ) ;
184
184
@@ -187,7 +187,7 @@ describe("<SendMessageComposer/>", () => {
187
187
const content : IContent = { } ;
188
188
attachMentions ( "@alice:test" , content , model , undefined ) ;
189
189
expect ( content ) . toEqual ( {
190
- "org.matrix.msc3952 .mentions" : { user_ids : [ "@bob:test" ] } ,
190
+ "m .mentions" : { user_ids : [ "@bob:test" ] } ,
191
191
} ) ;
192
192
} ) ;
193
193
@@ -198,27 +198,27 @@ describe("<SendMessageComposer/>", () => {
198
198
type : "m.room.message" ,
199
199
user : "@bob:test" ,
200
200
room : "!abc:test" ,
201
- content : { "org.matrix.msc3952 .mentions" : { } } ,
201
+ content : { "m .mentions" : { } } ,
202
202
event : true ,
203
203
} ) ;
204
204
let content : IContent = { } ;
205
205
attachMentions ( "@alice:test" , content , model , replyToEvent ) ;
206
206
expect ( content ) . toEqual ( {
207
- "org.matrix.msc3952 .mentions" : { user_ids : [ "@bob:test" ] } ,
207
+ "m .mentions" : { user_ids : [ "@bob:test" ] } ,
208
208
} ) ;
209
209
210
210
// It also adds any other mentioned users, but removes yourself.
211
211
replyToEvent = mkEvent ( {
212
212
type : "m.room.message" ,
213
213
user : "@bob:test" ,
214
214
room : "!abc:test" ,
215
- content : { "org.matrix.msc3952 .mentions" : { user_ids : [ "@alice:test" , "@charlie:test" ] } } ,
215
+ content : { "m .mentions" : { user_ids : [ "@alice:test" , "@charlie:test" ] } } ,
216
216
event : true ,
217
217
} ) ;
218
218
content = { } ;
219
219
attachMentions ( "@alice:test" , content , model , replyToEvent ) ;
220
220
expect ( content ) . toEqual ( {
221
- "org.matrix.msc3952 .mentions" : { user_ids : [ "@bob:test" , "@charlie:test" ] } ,
221
+ "m .mentions" : { user_ids : [ "@bob:test" , "@charlie:test" ] } ,
222
222
} ) ;
223
223
} ) ;
224
224
@@ -227,7 +227,7 @@ describe("<SendMessageComposer/>", () => {
227
227
const content : IContent = { } ;
228
228
attachMentions ( "@alice:test" , content , model , undefined ) ;
229
229
expect ( content ) . toEqual ( {
230
- "org.matrix.msc3952 .mentions" : { room : true } ,
230
+ "m .mentions" : { room : true } ,
231
231
} ) ;
232
232
} ) ;
233
233
@@ -238,13 +238,13 @@ describe("<SendMessageComposer/>", () => {
238
238
type : "m.room.message" ,
239
239
user : "@alice:test" ,
240
240
room : "!abc:test" ,
241
- content : { "org.matrix.msc3952 .mentions" : { room : true } } ,
241
+ content : { "m .mentions" : { room : true } } ,
242
242
event : true ,
243
243
} ) ;
244
244
const content : IContent = { } ;
245
245
attachMentions ( "@alice:test" , content , model , replyToEvent ) ;
246
246
expect ( content ) . toEqual ( {
247
- "org.matrix.msc3952 .mentions" : { } ,
247
+ "m .mentions" : { } ,
248
248
} ) ;
249
249
} ) ;
250
250
@@ -256,13 +256,13 @@ describe("<SendMessageComposer/>", () => {
256
256
user : "@alice:test" ,
257
257
room : "!abc:test" ,
258
258
// @ts -ignore - Purposefully testing invalid data.
259
- content : { "org.matrix.msc3952 .mentions" : { user_ids : "@bob:test" } } ,
259
+ content : { "m .mentions" : { user_ids : "@bob:test" } } ,
260
260
event : true ,
261
261
} ) ;
262
262
const content : IContent = { } ;
263
263
attachMentions ( "@alice:test" , content , model , replyToEvent ) ;
264
264
expect ( content ) . toEqual ( {
265
- "org.matrix.msc3952 .mentions" : { } ,
265
+ "m .mentions" : { } ,
266
266
} ) ;
267
267
} ) ;
268
268
@@ -273,21 +273,21 @@ describe("<SendMessageComposer/>", () => {
273
273
const prevContent : IContent = { } ;
274
274
attachMentions ( "@alice:test" , content , model , undefined , prevContent ) ;
275
275
expect ( content ) . toEqual ( {
276
- "org.matrix.msc3952 .mentions" : { } ,
277
- "m.new_content" : { "org.matrix.msc3952 .mentions" : { } } ,
276
+ "m .mentions" : { } ,
277
+ "m.new_content" : { "m .mentions" : { } } ,
278
278
} ) ;
279
279
} ) ;
280
280
281
281
it ( "mentions do not propagate" , ( ) => {
282
282
const model = new EditorModel ( [ ] , partsCreator ) ;
283
283
const content : IContent = { "m.new_content" : { } } ;
284
284
const prevContent : IContent = {
285
- "org.matrix.msc3952 .mentions" : { user_ids : [ "@bob:test" ] , room : true } ,
285
+ "m .mentions" : { user_ids : [ "@bob:test" ] , room : true } ,
286
286
} ;
287
287
attachMentions ( "@alice:test" , content , model , undefined , prevContent ) ;
288
288
expect ( content ) . toEqual ( {
289
- "org.matrix.msc3952 .mentions" : { } ,
290
- "m.new_content" : { "org.matrix.msc3952 .mentions" : { } } ,
289
+ "m .mentions" : { } ,
290
+ "m.new_content" : { "m .mentions" : { } } ,
291
291
} ) ;
292
292
} ) ;
293
293
@@ -297,19 +297,19 @@ describe("<SendMessageComposer/>", () => {
297
297
const prevContent : IContent = { } ;
298
298
attachMentions ( "@alice:test" , content , model , undefined , prevContent ) ;
299
299
expect ( content ) . toEqual ( {
300
- "org.matrix.msc3952 .mentions" : { user_ids : [ "@bob:test" ] } ,
301
- "m.new_content" : { "org.matrix.msc3952 .mentions" : { user_ids : [ "@bob:test" ] } } ,
300
+ "m .mentions" : { user_ids : [ "@bob:test" ] } ,
301
+ "m.new_content" : { "m .mentions" : { user_ids : [ "@bob:test" ] } } ,
302
302
} ) ;
303
303
} ) ;
304
304
305
305
it ( "test prev user mentions" , ( ) => {
306
306
const model = new EditorModel ( [ partsCreator . userPill ( "Bob" , "@bob:test" ) ] , partsCreator ) ;
307
307
const content : IContent = { "m.new_content" : { } } ;
308
- const prevContent : IContent = { "org.matrix.msc3952 .mentions" : { user_ids : [ "@bob:test" ] } } ;
308
+ const prevContent : IContent = { "m .mentions" : { user_ids : [ "@bob:test" ] } } ;
309
309
attachMentions ( "@alice:test" , content , model , undefined , prevContent ) ;
310
310
expect ( content ) . toEqual ( {
311
- "org.matrix.msc3952 .mentions" : { } ,
312
- "m.new_content" : { "org.matrix.msc3952 .mentions" : { user_ids : [ "@bob:test" ] } } ,
311
+ "m .mentions" : { } ,
312
+ "m.new_content" : { "m .mentions" : { user_ids : [ "@bob:test" ] } } ,
313
313
} ) ;
314
314
} ) ;
315
315
@@ -319,19 +319,19 @@ describe("<SendMessageComposer/>", () => {
319
319
const prevContent : IContent = { } ;
320
320
attachMentions ( "@alice:test" , content , model , undefined , prevContent ) ;
321
321
expect ( content ) . toEqual ( {
322
- "org.matrix.msc3952 .mentions" : { room : true } ,
323
- "m.new_content" : { "org.matrix.msc3952 .mentions" : { room : true } } ,
322
+ "m .mentions" : { room : true } ,
323
+ "m.new_content" : { "m .mentions" : { room : true } } ,
324
324
} ) ;
325
325
} ) ;
326
326
327
327
it ( "test prev room mention" , ( ) => {
328
328
const model = new EditorModel ( [ partsCreator . atRoomPill ( "@room" ) ] , partsCreator ) ;
329
329
const content : IContent = { "m.new_content" : { } } ;
330
- const prevContent : IContent = { "org.matrix.msc3952 .mentions" : { room : true } } ;
330
+ const prevContent : IContent = { "m .mentions" : { room : true } } ;
331
331
attachMentions ( "@alice:test" , content , model , undefined , prevContent ) ;
332
332
expect ( content ) . toEqual ( {
333
- "org.matrix.msc3952 .mentions" : { } ,
334
- "m.new_content" : { "org.matrix.msc3952 .mentions" : { room : true } } ,
333
+ "m .mentions" : { } ,
334
+ "m.new_content" : { "m .mentions" : { room : true } } ,
335
335
} ) ;
336
336
} ) ;
337
337
@@ -340,11 +340,11 @@ describe("<SendMessageComposer/>", () => {
340
340
const model = new EditorModel ( [ ] , partsCreator ) ;
341
341
const content : IContent = { "m.new_content" : { } } ;
342
342
// @ts -ignore - Purposefully testing invalid data.
343
- const prevContent : IContent = { "org.matrix.msc3952 .mentions" : { user_ids : "@bob:test" } } ;
343
+ const prevContent : IContent = { "m .mentions" : { user_ids : "@bob:test" } } ;
344
344
attachMentions ( "@alice:test" , content , model , undefined , prevContent ) ;
345
345
expect ( content ) . toEqual ( {
346
- "org.matrix.msc3952 .mentions" : { } ,
347
- "m.new_content" : { "org.matrix.msc3952 .mentions" : { } } ,
346
+ "m .mentions" : { } ,
347
+ "m.new_content" : { "m .mentions" : { } } ,
348
348
} ) ;
349
349
} ) ;
350
350
} ) ;
0 commit comments