Skip to content

Commit

Permalink
https://github.com/NodeBB/NodeBB/issues/11618
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed May 21, 2023
1 parent 6438c26 commit ac774fd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/css-builders.ts
Expand Up @@ -13,6 +13,7 @@ export function images(pack: EmojiDefinition): string {
'height: 23px;' +
'margin-top: -1px;' +
'margin-bottom: -1px;' +
'vertical-align: bottom;' +
'}';
}

Expand Down
14 changes: 14 additions & 0 deletions lib/parse.ts
Expand Up @@ -236,3 +236,17 @@ export async function postSummaries(data: { posts: [{ topic: { title: string } }
}
return data;
}

export async function notifications(
data: { notifications: [{ bodyShort: string } ] }
) : Promise<any> {
if (options.titles) {
await Promise.all(data.notifications.map(async (n) => {
if (n && n.bodyShort) {
// eslint-disable-next-line no-param-reassign
n.bodyShort = await parse(n.bodyShort);
}
}));
}
return data;
}
1 change: 1 addition & 0 deletions plugin.json
Expand Up @@ -34,6 +34,7 @@
{ "hook": "filter:topic.get", "method": "parse.topic" },
{ "hook": "filter:topics.get", "method": "parse.topics" },
{ "hook": "filter:post.getPostSummaryByPids", "method": "parse.postSummaries" },
{ "hook": "filter:user.notifications.getNotifications", "method": "parse.notifications" },
{ "hook": "filter:meta.getLinkTags", "method": "addStylesheet" },
{ "hook": "filter:config.get", "method": "configGet" }
]
Expand Down

0 comments on commit ac774fd

Please sign in to comment.