Process an incoming presence stanza `stanza_obj`.
352316
def _process_incoming_presence(self, stanza_obj):
        
        self._logger.debug("incoming presence: %r", stanza_obj)

        stanza_obj = self.service_inbound_presence_filter.filter(stanza_obj)
        if stanza_obj is None:
            self._logger.debug("incoming presence dropped by service filter"
                               " chain")
            return

        stanza_obj = self.app_inbound_presence_filter.filter(stanza_obj)
        if stanza_obj is None:
            self._logger.debug("incoming presence dropped by application "
                               "filter chain")
            return

        self.on_presence_received(stanza_obj)
996843
def after_object(eng, objects, obj):
        """"""
        # We save each object once it is fully run through
        super(InvenioProcessingFactory, InvenioProcessingFactory)\
            .after_object(eng, objects, obj)
        obj.save(
            status=obj.known_statuses.COMPLETED,
            id_workflow=eng.model.uuid
        )
        db.session.commit()
233306
def track(cls, obj, ptr):
        
        cls._objects.add(cls(obj, ptr))
257111
function resolveTransientScope(obj, override){
    var transientScope = obj.$transientScope || override;

    if (transientScope) {
      di.annotate(obj, new di.TransientScope());
    }
  }
863079
function processIgnores (visitor) {
    for (const ignorePattern of options.ignores) {
      const key = `${ignorePattern}:exit`

      if (visitor.hasOwnProperty(key)) {
        const handler = visitor[key]
        visitor[key] = function (node) {
          const ret = handler.apply(this, arguments)
          ignore(node)
          return ret
        }
      } else {
        visitor[key] = ignore
      }
    }

    return visitor
  }
899202
public void handleSuccess ()
    {
        if (_listener instanceof InvocationService.ConfirmListener) {
            reportRequestProcessed();
        } else if (_listener instanceof InvocationService.ResultListener && _resultSet) {
            reportRequestProcessed(_result);
        }
    }
997031
function create() {
  function app(stanza) { app.handle(stanza); }
  utils.merge(app, application);
  app._stack = [];
  app._filters = [];
  for (var i = 0; i < arguments.length; ++i) {
    app.use(arguments[i]);
  }
  return app;
}
714774
def update_presence(data)
      @status = data['status'].to_sym

      if data['game']
        game = data['game']

        @game = game['name']
        @stream_url = game['url']
        @stream_type = game['type']
      else
        @game = @stream_url = @stream_type = nil
      end
    end
1006642
def on_presence(self, session, presence):
        """"""
        from_jid = presence.getFrom()
        is_member = self.is_member(from_jid.getStripped())
        if is_member:
            member = self.get_member(from_jid.getStripped())
        else:
            member = None

        logger.info('presence: from=%s is_member=%s type=%s' % (from_jid, is_member, presence.getType()))

        if presence.getType() == 'subscribed':
            if is_member:
                logger.info('[%s] accepted their invitation' % (from_jid,))
                member['STATUS'] = 'ACTIVE'
            else:
                #TODO: user accepted, but is no longer be on the roster, unsubscribe?
                pass
        elif presence.getType() == 'subscribe':
            if is_member:
                logger.info('Acknowledging subscription request from [%s]' % (from_jid,))
                self.client.sendPresence(jid=from_jid, typ='subscribed')
                member['STATUS'] = 'ACTIVE'
                self.broadcast('%s has accepted their invitation!' % (from_jid,))
            else:
                #TODO: show that a user has requested membership?
                pass
        elif presence.getType() == None:
            if is_member:
                member['ONLINE'] += 1
        elif presence.getType() == 'unavailable':
            if is_member:
                member['ONLINE'] -= 1
        else:
            logger.info('Unhandled presence stanza of type [%s] from [%s]' % (presence.getType(), from_jid))
1010372
void notifyOmemoMessageReceived(Stanza stanza, OmemoMessage.Received decryptedMessage) {
        for (OmemoMessageListener l : omemoMessageListeners) {
            l.onOmemoMessageReceived(stanza, decryptedMessage);
        }
    }
554169
def _process_data(self, obj):
        """"""
        assert len(self._waiters) > 0, (type(obj), obj)
        waiter, encoding, cb = self._waiters.popleft()
        if isinstance(obj, RedisError):
            if isinstance(obj, ReplyError):
                if obj.args[0].startswith('READONLY'):
                    obj = ReadOnlyError(obj.args[0])
            _set_exception(waiter, obj)
            if self._in_transaction is not None:
                self._transaction_error = obj
        else:
            if encoding is not None:
                try:
                    obj = decode(obj, encoding)
                except Exception as exc:
                    _set_exception(waiter, exc)
                    return
            if cb is not None:
                try:
                    obj = cb(obj)
                except Exception as exc:
                    _set_exception(waiter, exc)
                    return
            _set_result(waiter, obj)
            if self._in_transaction is not None:
                self._in_transaction.append((encoding, cb))
767432
def _dict_to_stanza(key, stanza):
    '''
    
    '''
    ret = ''
    for skey in stanza:
        if stanza[skey] is True:
            stanza[skey] = ''
        ret += '    {0} {1}\n'.format(skey, stanza[skey])
    return '{0} {{\n{1}}}'.format(key, ret)
60868
def process(self, obj, pk_set=None, action=None, update_fields=None, **kwargs):
        """"""
        build_kwargs = self._get_build_kwargs(obj, pk_set, action, update_fields, **kwargs)

        if build_kwargs:
            self.index.build(**build_kwargs)
862500
def subscribe(&blk)
      pres = connection.presence_stanza('to'=>jid.bare, 'type' => 'subscribe')
      connection.send_stanza pres, &blk
    end
760935
def _process_incoming(self, xmlstream, queue_entry):
        

        stanza_obj, exc = queue_entry

        # first, handle SM stream objects
        if isinstance(stanza_obj, nonza.SMAcknowledgement):
            self._logger.debug("received SM ack: %r", stanza_obj)
            if not self._sm_enabled:
                self._logger.warning("received SM ack, but SM not enabled")
                return
            self.sm_ack(stanza_obj.counter)
            return
        elif isinstance(stanza_obj, nonza.SMRequest):
            self._logger.debug("received SM request: %r", stanza_obj)
            if not self._sm_enabled:
                self._logger.warning("received SM request, but SM not enabled")
                return
            response = nonza.SMAcknowledgement()
            response.counter = self._sm_inbound_ctr
            self._logger.debug("sending SM ack: %r", response)
            xmlstream.send_xso(response)
            return

        # raise if it is not a stanza
        if not isinstance(stanza_obj, stanza.StanzaBase):
            raise RuntimeError(
                "unexpected stanza class: {}".format(stanza_obj))

        # now handle stanzas, these always increment the SM counter
        if self._sm_enabled:
            self._sm_inbound_ctr += 1
            self._sm_inbound_ctr &= 0xffffffff

        # check if the stanza has errors
        if exc is not None:
            self._process_incoming_erroneous_stanza(stanza_obj, exc)
            return

        if isinstance(stanza_obj, stanza.IQ):
            self._process_incoming_iq(stanza_obj)
        elif isinstance(stanza_obj, stanza.Message):
            self._process_incoming_message(stanza_obj)
        elif isinstance(stanza_obj, stanza.Presence):
            self._process_incoming_presence(stanza_obj)
1244565
def process(self):
        """"""

        super(NativeBLEVirtualInterface, self).process()

        if (not self._stream_sm_running) and (not self.reports.empty()):
            self._stream_data()

        if (not self._trace_sm_running) and (not self.traces.empty()):
            self._send_trace()
667196
function StanzaFetcher(db, getInterchangeSession) {
  var self = this;
  self.db = db;
  self._closed = false;
  self.getInterchangeSession = getInterchangeSession;
  self._highWaterMarks = new Chain(self._fetchMostRecentStanzaSeq.bind(self));
  events.EventEmitter.call(this);
}