diff --git a/lib/redmine_discord/embed_objects/wiki_embeds.rb b/lib/redmine_discord/embed_objects/wiki_embeds.rb index 38a261b..6e9392f 100644 --- a/lib/redmine_discord/embed_objects/wiki_embeds.rb +++ b/lib/redmine_discord/embed_objects/wiki_embeds.rb @@ -26,4 +26,15 @@ def get_fields_color 255 end end + + class WikiNewEmbed < WikiEditEmbed + def get_title_tag + '[New wiki page]' + end + + def get_fields_color + # 00ffff + 65535 + end + end end \ No newline at end of file diff --git a/lib/redmine_discord/listener.rb b/lib/redmine_discord/listener.rb index 2628dec..60f4abd 100644 --- a/lib/redmine_discord/listener.rb +++ b/lib/redmine_discord/listener.rb @@ -38,7 +38,11 @@ def controller_wiki_edit_after_save(context={}) wiki_page = context[:page] project = wiki_page.project - embed_object = WikiEditEmbed.new context + embed_object = if wiki_page.content.version == 1 + WikiNewEmbed.new context + else + WikiEditEmbed.new context + end @dispatcher.dispatch embed_object, project end