mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-26 03:04:52 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			440 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			440 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /*
 | |
|  * SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
 | |
|  * SPDX-License-Identifier: AGPL-3.0-only
 | |
|  */
 | |
| 
 | |
| import * as Misskey from 'misskey-js';
 | |
| import { appendContentWarning } from '@@/js/append-content-warning.js';
 | |
| 
 | |
| export function computeMergedCw(note: Misskey.entities.Note): string | null {
 | |
| 	let cw = note.cw;
 | |
| 
 | |
| 	if (note.user.mandatoryCW) {
 | |
| 		cw = appendContentWarning(cw, note.user.mandatoryCW);
 | |
| 	}
 | |
| 
 | |
| 	return cw ?? null;
 | |
| }
 |