git ssb

2+

mixmix / ticktack



Commit 20ecb42e14437431422a5f7f0615b0f7f878cb64

don't your own messages as unread

Dominic Tarr committed on 11/19/2017, 9:14:50 PM
Parent: 7e24f761d4772ef1ac78ab33da6743bb7e1d821d

Files changed

app/html/context.jschanged
app/html/context.jsView
@@ -38,11 +38,13 @@
3838 pull.filter(msg => msg.value.content.type === 'post'), // TODO is this the best way to protect against votes?
3939 pull.filter(msg => msg.value.content.recps),
4040 pull.drain(msg => {
4141 var author = msg.value.author
42- if(api.unread.sync.isUnread(msg))
42+ if(api.unread.sync.isUnread(msg)) {
43+ var seen = author === myKey ? 0 : 1
4344 recentPeersContacted
44- .put(author, (recentPeersContacted.get(author)||0)+1)
45+ .put(author, (recentPeersContacted.get(author)||0)+seen)
46+ }
4547 else
4648 recentPeersContacted.put(author, 0)
4749 })
4850 )
@@ -52,8 +54,9 @@
5254 LevelTwoContext()
5355 ])
5456
5557 function LevelOneContext () {
58+ //the "discovery" button
5659 const PAGES_UNDER_DISCOVER = ['blogIndex', 'blogShow', 'home']
5760
5861 return h('div.level.-one', [
5962 // Nearby
@@ -88,9 +91,9 @@
8891 const lastMsg = value()
8992 if (nearby.has(feedId)) return
9093
9194 return Option({
92- //XXX not a random number of notifications.
95+ //the number of threads with each peer
9396 notifications: value,
9497 //Math.random() > 0.7 ? Math.floor(Math.random()*9+1) : 0, // TODO
9598 imageEl: api.about.html.avatar(feedId),
9699 label: api.about.obs.name(feedId),
@@ -159,4 +162,6 @@
159162 }
160163 })
161164 }
162165
166+
167+

Built with git-ssb-web