Skip to content

Commit

Permalink
feat: simplify the events format
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Aug 6, 2024
1 parent 76afb42 commit c7b2c8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions service/messages/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ func (f Format) convert(evt *pb.CloudEvent, subId, subDescr string, mode FormatM
addrInterest := "https://awakari.com/sub-details.html?id=" + subId
switch mode {
case FormatModeHtml:
txt += "Original: <a href=\"" + obj + "\">" + obj + "</a>\n"
txt += "Interest: <a href=\"" + addrInterest + "\">" + subDescr + "</a>\n"
txt += "Original: <a href=\"" + obj + "\">" + obj + "</a>\n\n"
txt += "Interest: <a href=\"" + addrInterest + "\">" + subDescr + "</a>\n\n"
txt += "<a href=\"" + addrEvtAttrs + "\">All Event Attributes</a>"
default:
txt += "Original: " + obj + "\nInterest: " + addrInterest + "\nAll Event Attributes: " + addrEvtAttrs
txt += "Original: " + obj + "\n\nInterest: " + addrInterest + "\n\nAll Event Attributes: " + addrEvtAttrs
}
//
return
Expand Down
2 changes: 1 addition & 1 deletion service/messages/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Increase your daily publication limit or nominate own sources for the dedicated
If you did not publish messages, <a href="https://awakari.com/pub.html?own=true">check own publication sources</a> you added.`,
},
},
out: "⚠ Daily publishing limit reached.\n\nIncrease your daily publication limit or nominate own sources for the dedicated limit.\n\nIf you did not publish messages, <a href=\"https://awakari.com/pub.html?o...\n\nAttributes: <a href=\"/82f39262-5eb4-4f7f-9142-7c489d670907\">82f39262-5eb4-4f7f-9142-7c489d670907</a>\n\nInterest: <a href=\"https://awakari.com/sub-details.html?id=sub1\">sub1 description</a>",
out: "⚠ Daily publishing limit reached.\n\nIncrease your daily publication limit or nominate own source...\n\nOriginal: <a href=\"https://bbs.archlinux.org/extern.php?action=feed&fid=32&type=atom\">https://bbs.archlinux.org/extern.php?action=feed&fid=32&type=atom</a>\n\nInterest: <a href=\"https://awakari.com/sub-details.html?id=sub1\">sub1 description</a>\n\n<a href=\"/82f39262-5eb4-4f7f-9142-7c489d670907\">All Event Attributes</a>",
},
}
for k, c := range cases {
Expand Down

0 comments on commit c7b2c8d

Please sign in to comment.