<commit_before>var h = require('hyperscript')
var u = require('../util')
var pull = require('pull-stream')
var Scroller = require('pull-scroll')
var paramap = require('pull-paramap')
var plugs = require('../plugs')
var cont = require('cont')

var message_render = plugs.first(exports.message_render = [])
var sbot_log = plugs.first(exports.sbot_log = [])
var sbot_get = plugs.first(exports.sbot_get = [])
var sbot_user_feed = plugs.first(exports.sbot_user_feed = [])
var message_unbox = plugs.first(exports.message_unbox = [])

function unbox() {
  return pull(
    pull.map(function (msg) {
      return msg.value && 'string' === typeof msg.value.content ?
        message_unbox(msg) : msg
    }),
    pull.filter(Boolean)
  )
}

function notifications(ourIds) {

  function linksToUs(link) {
    return link && link.link in ourIds
  }

  function isOurMsg(id, cb) {
    sbot_get(id, function (err, msg) {
      if (err && err.name == 'NotFoundError') cb(null, false)
      else if (err) cb(err)
      else cb(err, msg.author in ourIds)
    })
  }

  return paramap(function (msg, cb) {
    var c = msg.value && msg.value.content
    if (!c || typeof c !== 'object') return cb()
    if (msg.value.author in ourIds) return cb()
<commit_msg>Show notification for post on issue of own repo<commit_after>var h = require('hyperscript')
var u = require('../util')
var pull = require('pull-stream')
var Scroller = require('pull-scroll')
var paramap = require('pull-paramap')
var plugs = require('../plugs')
var cont = require('cont')

var message_render = plugs.first(exports.message_render = [])
var sbot_log = plugs.first(exports.sbot_log = [])
var sbot_get = plugs.first(exports.sbot_get = [])
var sbot_user_feed = plugs.first(exports.sbot_user_feed = [])
var message_unbox = plugs.first(exports.message_unbox = [])

function unbox() {
  return pull(
    pull.map(function (msg) {
      return msg.value && 'string' === typeof msg.value.content ?
        message_unbox(msg) : msg
    }),
    pull.filter(Boolean)
  )
}

function notifications(ourIds) {

  function linksToUs(link) {
    return link && link.link in ourIds
  }

  function isOurMsg(id, cb) {
    sbot_get(id, function (err, msg) {
      if (err && err.name == 'NotFoundError') cb(null, false)
      else if (err) cb(err)
      else if (msg.content.type === 'issue' || msg.content.type === 'project')
        isOurMsg(msg.content.repo || msg.content.project, cb)
      else cb(err, msg.author in ourIds)
    })
  }

  return paramap(function (msg, cb) {
    var c = msg.value && msg.value.content
    if (!c || typeof c !== 'object') return cb()
    if (msg.value.author in ourIds) return cb()

{'fraction_non_alphanumeric': 0.15329566854990584, 'fraction_numerical': 0.0, 'mean_word_length': 3.579310344827586, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3361282', 'n_tokens_mistral': 913, 'n_tokens_neox': 890, 'n_words': 221}