mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	renamed toMastoHtml to toMastoApiHtml to clear up what it does
This commit is contained in:
		
							parent
							
								
									145c4ba132
								
							
						
					
					
						commit
						1656c02536
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -459,10 +459,10 @@ export class MfmService {
 | 
				
			||||||
		return `<p>${doc.body.innerHTML}</p>`;
 | 
							return `<p>${doc.body.innerHTML}</p>`;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// the toMastoHtml function was taken from Iceshrimp and written by zotan and modified by marie to work with the current MK version
 | 
						// the toMastoApiHtml function was taken from Iceshrimp and written by zotan and modified by marie to work with the current MK version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@bindThis
 | 
						@bindThis
 | 
				
			||||||
	public async toMastoHtml(nodes: mfm.MfmNode[] | null, mentionedRemoteUsers: IMentionedRemoteUsers = [], inline = false, quoteUri: string | null = null) {
 | 
						public async toMastoApiHtml(nodes: mfm.MfmNode[] | null, mentionedRemoteUsers: IMentionedRemoteUsers = [], inline = false, quoteUri: string | null = null) {
 | 
				
			||||||
		if (nodes == null) {
 | 
							if (nodes == null) {
 | 
				
			||||||
			return null;
 | 
								return null;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -110,7 +110,7 @@ export class MastoConverters {
 | 
				
			||||||
	private async encodeField(f: Entity.Field): Promise<Entity.Field> {
 | 
						private async encodeField(f: Entity.Field): Promise<Entity.Field> {
 | 
				
			||||||
		return {
 | 
							return {
 | 
				
			||||||
			name: f.name,
 | 
								name: f.name,
 | 
				
			||||||
			value: await this.mfmService.toMastoHtml(mfm.parse(f.value), [], true) ?? escapeMFM(f.value),
 | 
								value: await this.mfmService.toMastoApiHtml(mfm.parse(f.value), [], true) ?? escapeMFM(f.value),
 | 
				
			||||||
			verified_at: null,
 | 
								verified_at: null,
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -179,7 +179,7 @@ export class MastoConverters {
 | 
				
			||||||
			const files = this.driveFileEntityService.packManyByIds(edit.fileIds);
 | 
								const files = this.driveFileEntityService.packManyByIds(edit.fileIds);
 | 
				
			||||||
			const item = {
 | 
								const item = {
 | 
				
			||||||
				account: noteUser,
 | 
									account: noteUser,
 | 
				
			||||||
				content: this.mfmService.toMastoHtml(mfm.parse(edit.newText ?? ''), JSON.parse(note.mentionedRemoteUsers)).then(p => p ?? ''),
 | 
									content: this.mfmService.toMastoApiHtml(mfm.parse(edit.newText ?? ''), JSON.parse(note.mentionedRemoteUsers)).then(p => p ?? ''),
 | 
				
			||||||
				created_at: lastDate.toISOString(),
 | 
									created_at: lastDate.toISOString(),
 | 
				
			||||||
				emojis: [],
 | 
									emojis: [],
 | 
				
			||||||
				sensitive: files.then(files => files.length > 0 ? files.some((f) => f.isSensitive) : false),
 | 
									sensitive: files.then(files => files.length > 0 ? files.some((f) => f.isSensitive) : false),
 | 
				
			||||||
| 
						 | 
					@ -240,7 +240,7 @@ export class MastoConverters {
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		const content = note.text !== null
 | 
							const content = note.text !== null
 | 
				
			||||||
			? quoteUri.then(quoteUri => this.mfmService.toMastoHtml(mfm.parse(note.text!), JSON.parse(note.mentionedRemoteUsers), false, quoteUri))
 | 
								? quoteUri.then(quoteUri => this.mfmService.toMastoApiHtml(mfm.parse(note.text!), JSON.parse(note.mentionedRemoteUsers), false, quoteUri))
 | 
				
			||||||
				.then(p => p ?? escapeMFM(note.text!))
 | 
									.then(p => p ?? escapeMFM(note.text!))
 | 
				
			||||||
			: '';
 | 
								: '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue