mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Handle no body
This commit is contained in:
parent
07bd0e8be4
commit
135d5a51d2
@ -60,7 +60,7 @@ export class NotificationProcessor {
|
|||||||
if (diff) {
|
if (diff) {
|
||||||
plain += "\n\n ";
|
plain += "\n\n ";
|
||||||
if (diff.merged) {
|
if (diff.merged) {
|
||||||
plain += `\n\n PR was merged by ${diff.mergedBy ? NotificationProcessor.formatUser(diff.mergedBy) : ""}`;
|
plain += `\n\n PR was merged by ${diff.mergedBy ? NotificationProcessor.formatUser(diff.mergedBy) : ""}`;
|
||||||
} else if (diff.state) {
|
} else if (diff.state) {
|
||||||
const state = diff.state[0].toUpperCase() + diff.state.slice(1).toLowerCase();
|
const state = diff.state[0].toUpperCase() + diff.state.slice(1).toLowerCase();
|
||||||
plain += `\n\n State changed to: ${state}`;
|
plain += `\n\n State changed to: ${state}`;
|
||||||
@ -75,7 +75,11 @@ export class NotificationProcessor {
|
|||||||
if (newComment) {
|
if (newComment) {
|
||||||
const comment = notif.subject.latest_comment_url_data as IssuesGetCommentResponseData;
|
const comment = notif.subject.latest_comment_url_data as IssuesGetCommentResponseData;
|
||||||
const user = comment.user ? NotificationProcessor.formatUser(comment.user) : 'user';
|
const user = comment.user ? NotificationProcessor.formatUser(comment.user) : 'user';
|
||||||
plain += `\n\n ${user}:\n\n > ${comment.body}`;
|
if (comment.body) {
|
||||||
|
plain += `\n\n ${user}:\n\n > ${comment.body}`;
|
||||||
|
} else {
|
||||||
|
plain += `\n\n ${user}:\n\n posted with no body`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
plain,
|
plain,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user