fix m->d message deletions
This commit is contained in:
		
							parent
							
								
									708955c062
								
							
						
					
					
						commit
						53baeb5df7
					
				
					 2 changed files with 4 additions and 7 deletions
				
			
		| 
						 | 
					@ -2,11 +2,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Known issues
 | 
					## Known issues
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- d->m emojis do not work at all (inline chat, single emoji size, reactions, bridged state)
 | 
					 | 
				
			||||||
- d->m embeds
 | 
					 | 
				
			||||||
- m->d code blocks have slightly too much spacing
 | 
					- m->d code blocks have slightly too much spacing
 | 
				
			||||||
- m->d deletions
 | 
					 | 
				
			||||||
- removing reactions
 | 
					 | 
				
			||||||
- rooms will be set up even if the bridge does not have permission for the channels, which breaks when it restarts and tries to fetch messages
 | 
					- rooms will be set up even if the bridge does not have permission for the channels, which breaks when it restarts and tries to fetch messages
 | 
				
			||||||
	- test private threads as part of this
 | 
						- test private threads as part of this
 | 
				
			||||||
	- solution part 1: calculate the permissions to see if the bot should be able to do stuff
 | 
						- solution part 1: calculate the permissions to see if the bot should be able to do stuff
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,9 +12,10 @@ const utils = sync.require("../converters/utils")
 | 
				
			||||||
 * @param {Ty.Event.Outer_M_Room_Redaction} event
 | 
					 * @param {Ty.Event.Outer_M_Room_Redaction} event
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
async function deleteMessage(event) {
 | 
					async function deleteMessage(event) {
 | 
				
			||||||
	const row = from("event_message").join("message_channel", "message_id").select("channel_id", "message_id").and("WHERE event_id = ?").get(event.event_id)
 | 
						const rows = from("event_message").join("message_channel", "message_id").select("channel_id", "message_id").and("WHERE event_id = ?").all(event.redacts)
 | 
				
			||||||
	if (!row) return
 | 
						for (const row of rows) {
 | 
				
			||||||
	return discord.snow.channel.deleteMessage(row.channel_id, row.message_id, event.content.reason)
 | 
							discord.snow.channel.deleteMessage(row.channel_id, row.message_id, event.content.reason)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue