Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
Open
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
9 changes: 5 additions & 4 deletions lib/prog/channels/syncopator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'pay_dirt'
require 'cgi'

module Prog
module Channels
Expand Down Expand Up @@ -36,9 +37,9 @@ def syncopate
"Creation Date" => Time.at(channel[:created]).strftime("%m/%d/%Y"),
"Membership" => channel[:num_members],
"Status" => channel[:is_archived] ? "Archived" : "Active",
"Channel Purpose" => channel[:purpose][:value],
"Channel Purpose" => CGI.unescapeHTML(channel[:purpose][:value]),
"Last Activity" => Time.at((channel_details&.latest&.ts || channel_details&.last_read).to_f).strftime("%m/%d/%Y"),
"Channel Topic" => channel_details.topic.value,
"Channel Topic" => CGI.unescapeHTML(channel_details.topic.value),
})

new_channel.create
Expand All @@ -50,10 +51,10 @@ def syncopate
existing_channel["Channel Name"] = channel[:name]
existing_channel["Creation Date"] = Time.at(channel[:created]).strftime("%m/%d/%Y")
existing_channel["Membership"] = channel[:num_members]
existing_channel["Channel Purpose"] = channel[:purpose][:value]
existing_channel["Channel Purpose"] = CGI.unescapeHTML(channel[:purpose][:value])
existing_channel["Status"] = "Archived" if channel[:is_archived]
existing_channel["Last Activity"] = Time.at((channel_details&.latest&.ts || channel_details&.last_read).to_f).strftime("%m/%d/%Y")
existing_channel["Channel Topic"] = channel_details.topic.value
existing_channel["Channel Topic"] = CGI.unescapeHTML(channel_details.topic.value)

existing_channel.save
else
Expand Down