M hummingbird_ajax.js => hummingbird_ajax.js +14 -15
@@ 239,21 239,20 @@ function parseMessageEvents(events, room) {
// format: "org.matrix.custom.html"
// Check if we have any edits or replies.
- switch (e.content['m.relates_to']?.rel_type) {
- case undefined:
- // No relation exists.
- break
- case 'm.replace':
- m.edit = e.content['m.relates_to'].event_id
- // Manually merge the new message as someone may have changed the type.
- m.type = e.content['m.new_content'].msgtype
- m.body = e.content['m.new_content'].formatted_body ||
- e.content['m.new_content'].formatted_body
- break
- case 'net.maunium.reply':
- default:
- m.reply = e.content['m.relates_to']['m.in_reply_to'].event_id
- break
+ if (e.content['m.relates_to']) {
+ switch (e.content['m.relates_to'].rel_type) {
+ case 'm.replace':
+ m.edit = e.content['m.relates_to'].event_id
+ // Manually merge the new message as someone may have changed the type.
+ m.type = e.content['m.new_content'].msgtype
+ m.body = e.content['m.new_content'].formatted_body ||
+ e.content['m.new_content'].formatted_body
+ break
+ case 'net.maunium.reply':
+ default:
+ m.reply = e.content['m.relates_to']['m.in_reply_to'].event_id
+ break
+ }
}
break