add support for html-formatted matrix messages
This commit is contained in:
		
							parent
							
								
									0d6e3b349d
								
							
						
					
					
						commit
						8f8d5972aa
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -71,6 +71,17 @@ export default async function (matrixClient, event, room, toStartOfTimeline) { | |||
|                 }); | ||||
|             } else if (typeof result === "object") { | ||||
|               // console.log(result)
 | ||||
|               if (result.html) { | ||||
|                 const content = { | ||||
|                   format: "org.matrix.custom.html", | ||||
|                   body: result.html, | ||||
|                   formatted_body: result.html, | ||||
|                   msgtype: "m.text", | ||||
|                 }; | ||||
|                 matrixClient.sendEvent(event.event.room_id, "m.room.message", content, "", (err, res) => { | ||||
|                     console.log(err); | ||||
|                 }); | ||||
|               } | ||||
|               if (result.contents && result.name) { | ||||
|                 let fileSize = 52428308; | ||||
|                 if (result.contents.length > fileSize) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue