   # this method will prevent the arrival of
   # realtime messages to the individual messages
   # if the message is mine and current window has focus.
-  isFromOtherBrowser = (message, event) ->
+  isFromOtherBrowser = (message) ->
 
     # selenium doesn't put focus into the
     # spawned browser, it's causing problems.

      when 'post', 'message'           then @message.byId {id}, kallback
      else callback { message: "#{type} not implemented in revive" }

  getMessageEvents = ->
    [
      {event: "MessageAdded",       mapperFn: mapActivity, validatorFn: isFromOtherBrowser}
      {event: "MessageRemoved",     mapperFn: mapActivity, validatorFn: isFromOtherBrowser}
      {event: "AddedToChannel",     mapperFn: mapParticipant}
      {event: "RemovedFromChannel", mapperFn: mapParticipant}

  forwardMessageEvents : forwardMessageEvents
  forwardMessageEvents = (source, target, events) ->

    events.forEach ({event, mapperFn, validatorFn, filterFn}) ->
      source.on event, (data, rest...) ->

        if validatorFn
          if typeof validatorFn isnt "function"
            return warn "validator function is not valid"

          return  unless validatorFn(data)

        if filterFn
          if typeof filterFn isnt "function"
            return warn "filter function is not valid"

          return  unless filterFn(data)

        data = mapperFn data

        target.emit event, data, rest...


  # While making retrospective realtime message query, it is possible to fetch an already
  # existing message. This is for preventing the case.
  filterMessage = (data) ->
    {message} = data  unless data.typeConstant?
    if cachedMessage = KD.singletons.socialapi._cache?[message.typeConstant]?[message.id]
      return yes  if cachedMessage.isShown

    message.isShown = yes


  registerAndOpenChannels = (socialApiChannels) ->
