mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	upd: make new posts be marked as NSFW if instance is marked as NSFW
Closes #226
This commit is contained in:
		
							parent
							
								
									9c6a7aed98
								
							
						
					
					
						commit
						4ca3c05487
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -368,6 +368,14 @@ export class NoteCreateService implements OnApplicationShutdown {
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (user.host && !data.cw) {
 | 
				
			||||||
 | 
								await this.federatedInstanceService.fetch(user.host).then(async i => {
 | 
				
			||||||
 | 
									if (i.isNSFW) {
 | 
				
			||||||
 | 
										data.cw = 'Instance is marked as NSFW';
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		const note = await this.insertNote(user, data, tags, emojis, mentionedUsers);
 | 
							const note = await this.insertNote(user, data, tags, emojis, mentionedUsers);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		setImmediate('post created', { signal: this.#shutdownController.signal }).then(
 | 
							setImmediate('post created', { signal: this.#shutdownController.signal }).then(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue