@@ -21,9 +21,9 @@ function Hallway (sites) {
2121 const channels = this.findChannels(entries)
2222 const users = this.findUsers(entries)
2323
24− let _entries = entries.reduce((acc, val, id) => { return acc + this.templateEntry(val) + '\n' }, '')
25− let _channels = Object.keys(channels).reduce((acc, val, id) => { return acc + `<li>${val} <span class='right'>${channels[val]}</span></li>\n` }, '')
26− let _users = Object.keys(users).reduce((acc, val, id) => { return acc + `<li>${val} <span class='right'>${users[val]}</span></li>\n` }, '')
24+ const _entries = entries.filter((val,id) => { return id < 50 }).reduce((acc, val, id) => { return acc + this.templateEntry(val) + '\n' }, '')
25+ const _channels = Object.keys(channels).reduce((acc, val, id) => { return acc + `<li>${val} <span class='right'>${channels[val]}</span></li>\n` }, '')
26+ const _users = Object.keys(users).reduce((acc, val, id) => { return acc + `<li>${val} <span class='right'>${users[val]}</span></li>\n` }, '')
2727
2828 this.el.innerHTML = `
2929 <ul id='entries'>
@@ -64,28 +64,22 @@ function Hallway (sites) {
6464 this.findEntries = function (feeds) {
6565 const a = []
6666 for (const id in feeds) {
67− const feed = feeds[id]
68− for (const i in feed.content) {
69− const entry = feed.content[i]
70− a.push(entry)
67+ for (const i in feeds[id].content) {
68+ a.push(feeds[id].content[i])
7169 }
7270 }
7371 return a.sort(compare)
7472 }
7573
7674 this.templateEntry = function (entry) {
77− // Find mention
78− if (entry.body.indexOf('@<') > -1) {
79− const data = entry.body.split('@<').pop().split('>')[0]
80− const mention = data.split(' ')
81− const name = mention[0]
82− const path = mention[1]
83− entry.body = entry.body.replace(`@<${data}>`, `<a href='${path}'>@${name}</a>`)
75+ if (entry.body.substr(0, 1) === '@') {
76+ const user = entry.body.split(' ')[0]
77+ entry.body = entry.body.replace(user, `<span class='user'>${user.toLowerCase()}</span>`)
8478 }
8579
8680 if (entry.body.substr(0, 1) === '/') {
8781 const channel = entry.body.split(' ')[0]
88− entry.body = entry.body.replace(channel, `<span class='channel'>${channel}</span>`)
82+ entry.body = entry.body.replace(channel, `<span class='channel'>${channel.toLowerCase()}</span>`)
8983 }
9084
9185 const filter = window.location.hash.substr(1).replace(/\+/g, ' ').toLowerCase()
@@ -116,7 +110,6 @@ function Hallway (sites) {
116110
117111 this.fetchFeed = function (id, feed) {
118112 console.log(`Fetching ${id}(${feed.path})..`)
119−
120113 fetch(feed.path, { cache: 'no-store' }).then(x => x.text()).then((content) => {
121114 feeds[id].content = parseFeed(id, content)
122115 this.refresh(feeds)