Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Suppress duplicate messages caused by nonconforming ics #177

Merged
merged 1 commit into from
Dec 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions plugins/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,16 @@ def dates(bot, mask, target, args):
k['datetime_sort'], "%d.%m.%Y %H:%M").timetuple()))

"""
spit out all events in database into IRC. If there were no
events, print some message about this...
Spit out all events in database into IRC. Suppress duplicate lines
from nonconforming ics files. If there were no events, print some
message about this...
"""
last_output = None
for ev in data:
bot.privmsg(target, " %s - %s" % (ev['datetime'], ev['info']))
output = " %s - %s" % (ev['datetime'], ev['info'])
if last_output != output:
last_output = output
bot.privmsg(target, output)

if found == 0:
bot.privmsg(target, "No dates during the next week")
Expand Down