@@ -94,10 +94,17 @@ function Hallway (sites) {
9494 return a.sort( (a, b) => a.offset - b.offset )
9595 }
9696
97+ this.findMention = function (found) {
98+ const mention = Object.keys(feeds).filter(user => found.indexOf(feeds[user].path) > -1)
99+ return mention.length === 1
100+ ? ` <span class='user'>@${mention[0]}</span>`
101+ : ` <span class='user'>${found}</span>`
102+ }
103+
97104 this.templateEntry = function (entry) {
98105 entry.html = entry.body
99106 .replace(re_channel, `$1<span class='channel'>/$2</span>`)
100− .replace(re_user, ` <span class='user'>$1</span>`)
107+ .replace(re_user, this.findMention)
101108 .replace(re_tag, `$1<span class='tag'>#$2</span>`)
102109 .replace(re_url, `<a target="_blank" href='$1'>$1</a>`)
103110