git ssb

10+

Matt McKegg / patchwork



Commit c1bbd85b688758bb943822743d5ad75bf3761ab1

only add a person to msg.recps once

Matt McKegg committed on 12/8/2017, 3:01:56 AM
Parent: 14aa0c908e6998e264adfa0aeba8af2113dd4286

Files changed

modules/page/html/render/private.jschanged
modules/page/html/render/private.jsView
@@ -21,11 +21,17 @@
2121 var compose = api.message.html.compose({
2222 meta: {type: 'post'},
2323 isPrivate: true,
2424 prepublish: function (msg) {
25- msg.recps = [id].concat(msg.mentions).filter(function (e) {
26- return ref.isFeed(typeof e === 'string' ? e : e.link)
25 + msg.recps = [id]
26 +
27 + msg.mentions.forEach(mention => {
28 + mention = typeof mention === 'string' ? mention : mention.link
29 + if (ref.isFeed(mention) && !msg.recps.includes(mention)) {
30 + msg.recps.push(mention)
31 + }
2732 })
33 +
2834 return msg
2935 },
3036 placeholder: i18n('Write a private message')
3137 })

Built with git-ssb-web