Fix bug (#5453)
This commit is contained in:
		| @@ -1,6 +1,6 @@ | |||||||
| import autobind from 'autobind-decorator'; | import autobind from 'autobind-decorator'; | ||||||
| import Channel from '../channel'; | import Channel from '../channel'; | ||||||
| import { Mutings } from '../../../../models'; | import { Mutings, Notes } from '../../../../models'; | ||||||
|  |  | ||||||
| export default class extends Channel { | export default class extends Channel { | ||||||
| 	public readonly chName = 'main'; | 	public readonly chName = 'main'; | ||||||
| @@ -13,17 +13,25 @@ export default class extends Channel { | |||||||
|  |  | ||||||
| 		// Subscribe main stream channel | 		// Subscribe main stream channel | ||||||
| 		this.subscriber.on(`mainStream:${this.user!.id}`, async data => { | 		this.subscriber.on(`mainStream:${this.user!.id}`, async data => { | ||||||
| 			const { type, body } = data; | 			let { type, body } = data; | ||||||
|  |  | ||||||
| 			switch (type) { | 			switch (type) { | ||||||
| 				case 'notification': { | 				case 'notification': { | ||||||
| 					if (mute.map(m => m.muteeId).includes(body.userId)) return; | 					if (mute.map(m => m.muteeId).includes(body.userId)) return; | ||||||
| 					if (body.note && body.note.isHidden) return; | 					if (body.note && body.note.isHidden) { | ||||||
|  | 						body.note = await Notes.pack(body.note.id, this.user, { | ||||||
|  | 							detail: true | ||||||
|  | 						}); | ||||||
|  | 					} | ||||||
| 					break; | 					break; | ||||||
| 				} | 				} | ||||||
| 				case 'mention': { | 				case 'mention': { | ||||||
| 					if (mute.map(m => m.muteeId).includes(body.userId)) return; | 					if (mute.map(m => m.muteeId).includes(body.userId)) return; | ||||||
| 					if (body.isHidden) return; | 					if (body.isHidden) { | ||||||
|  | 						body = await Notes.pack(body.id, this.user, { | ||||||
|  | 							detail: true | ||||||
|  | 						}); | ||||||
|  | 					} | ||||||
| 					break; | 					break; | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo