only add shortcode for custom image reactions
This commit is contained in:
		
							parent
							
								
									6dcf3a383a
								
							
						
					
					
						commit
						c3040f19c2
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -26,6 +26,7 @@ async function addReaction(data) {
 | 
				
			||||||
	assert.equal(typeof parentID, "string")
 | 
						assert.equal(typeof parentID, "string")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const key = await emojiToKey.emojiToKey(data.emoji)
 | 
						const key = await emojiToKey.emojiToKey(data.emoji)
 | 
				
			||||||
 | 
						const shortcode = key.startsWith("mxc://") ? `:${data.emoji.name}:` : undefined
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const roomID = await createRoom.ensureRoom(data.channel_id)
 | 
						const roomID = await createRoom.ensureRoom(data.channel_id)
 | 
				
			||||||
	const senderMxid = await registerUser.ensureSimJoined(user, roomID)
 | 
						const senderMxid = await registerUser.ensureSimJoined(user, roomID)
 | 
				
			||||||
| 
						 | 
					@ -35,7 +36,7 @@ async function addReaction(data) {
 | 
				
			||||||
			event_id: parentID,
 | 
								event_id: parentID,
 | 
				
			||||||
			key
 | 
								key
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		shortcode: `:${data.emoji.name}:`
 | 
							shortcode
 | 
				
			||||||
	}, senderMxid)
 | 
						}, senderMxid)
 | 
				
			||||||
	return eventID
 | 
						return eventID
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue