Skip to content
Snippets Groups Projects
Unverified Commit e3e6f51c authored by tribut's avatar tribut :man_dancing:
Browse files

Avoid duplicate notifications

This should really be a property of the conference, will have to clean
up later.
parent b122c96f
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,8 @@ class TelegramBotSubscriber ...@@ -16,6 +16,8 @@ class TelegramBotSubscriber
session = event.payload[:record] session = event.payload[:record]
changes = event.payload[:changes] changes = event.payload[:changes]
return if session.conference.slug.ends_with?("-more")
return unless changes.any? do |attr, (from, to)| return unless changes.any? do |attr, (from, to)|
%w[title language status starts_at ends_at stage_id].include? attr %w[title language status starts_at ends_at stage_id].include? attr
end end
...@@ -39,6 +41,8 @@ class TelegramBotSubscriber ...@@ -39,6 +41,8 @@ class TelegramBotSubscriber
session_speaker = event.payload[:record] session_speaker = event.payload[:record]
session = session_speaker.session session = session_speaker.session
return if session.conference.slug.ends_with?("-more")
return unless session.conference.relevant_stages.include? session.stage return unless session.conference.relevant_stages.include? session.stage
message = "<b><a href=\"#{conference_session_url(session.conference, session, host: 'rescheduled.c3lingo.org', protocol: 'https')}\">Session #{session.title}</a></b>\n<b>Speaker Change</b>\n" + message = "<b><a href=\"#{conference_session_url(session.conference, session, host: 'rescheduled.c3lingo.org', protocol: 'https')}\">Session #{session.title}</a></b>\n<b>Speaker Change</b>\n" +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment