@@ -92,9 +92,7 @@ function Hallway (sites) {
93 this.findMention = function (found) {
93 this.findMention = function (found) {
94 const mention = Object.keys(feeds).filter(user => found.indexOf(feeds[user].path) > -1)
94 const mention = Object.keys(feeds).filter(user => found.indexOf(feeds[user].path) > -1)
95− return mention.length === 1
96− ? ` <span class='user'>@${mention[0]}</span>`
95+ return mention.length === 1 ? ` <span class='user'>@${mention[0]}</span>` : ` <span class='user'>${found}</span>`
97− : ` <span class='user'>${found}</span>`
100 this.templateEntry = function (entry) {
98 this.templateEntry = function (entry) {
@@ -161,9 +159,8 @@ function Hallway (sites) {
162 function timeAgo (dateParam) {
160 function timeAgo (dateParam) {
163 const date = typeof dateParam === 'object' ? dateParam : new Date(dateParam)
161 const date = typeof dateParam === 'object' ? dateParam : new Date(dateParam)
164− const DAY_IN_MS = 86400000 // 24 * 60 * 60 * 1000
165 const today = new Date()
162 const today = new Date()
166− const yesterday = new Date(today - DAY_IN_MS)
163+ const yesterday = new Date(today - 86400000)
167 const seconds = Math.round((today - date) / 1000)
164 const seconds = Math.round((today - date) / 1000)
168 const minutes = Math.round(seconds / 60)
165 const minutes = Math.round(seconds / 60)
169 const isToday = today.toDateString() === date.toDateString()
166 const isToday = today.toDateString() === date.toDateString()
@@ -185,10 +182,10 @@ function Hallway (sites) {
186 return `${Math.floor(minutes / 1440)} days ago`
183 return `${Math.floor(minutes / 1440)} days ago`
189− function escapeHtml (unsafe) {
187+function escapeHtml (unsafe) {
190− return unsafe.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''')
188+ return unsafe.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''')
194function filter (name) {
191function filter (name) {