Processes a message of type INVITE.

\param string $origin
Origin of the message to process.

\param Erebot::Interfaces::IrcTextWrapper $msg
The message to process, wrapped in
a special object that makes it easier
to analyze each token separately.
332631
protected function handleINVITE($origin, $msg)
    {
        // :nick1!ident@host INVITE nick2 :#chan
        return $this->connection->dispatch(
            $this->makeEvent('!Invite', $msg[1], $origin, $msg[0])
        );
    }
859471
private function processRegister(Session $session, RegisterMessage $msg)
    {
        // check for valid URI
        if (!Utils::uriIsValid($msg->getProcedureName())) {
            $session->sendMessage(ErrorMessage::createErrorMessageFromMessage($msg, 'wamp.error.invalid_uri'));

            return;
        }

        //Check to see if the procedure is already registered
        /** @var Procedure $procedure */
        if (isset($this->procedures[$msg->getProcedureName()])) {
            $procedure = $this->procedures[$msg->getProcedureName()];
        } else {
            $procedure                                  = new Procedure($msg->getProcedureName());
            $this->procedures[$msg->getProcedureName()] = $procedure;
        }

        if ($procedure->processRegister($session, $msg)) {
            // registration succeeded
            // make sure we have the registration in the collection
            // of registrations for this session
            if (!$this->registrationsBySession->contains($session)) {
                $this->registrationsBySession->attach($session, []);
            }
            $registrationsForThisSession = $this->registrationsBySession[$session];

            if (!in_array($procedure, $registrationsForThisSession, true)) {
                $registrationsForThisSession[] = $procedure;
                
                $this->registrationsBySession[$session] = $registrationsForThisSession;
            }
        }
    }
541048
def receive_invite(opts = {})
      recv(opts.merge(request: 'INVITE', rrs: true)) do |recv|
        action = doc.create_element('action') do |action|
          action << doc.create_element('ereg') do |ereg|
            ereg['regexp'] = '<sip:(.*)>.*;tag=([^;]*)'
            ereg['search_in'] = 'hdr'
            ereg['header'] = 'From:'
            ereg['assign_to'] = 'dummy,remote_addr,remote_tag'
          end
          action << doc.create_element('ereg') do |ereg|
            ereg['regexp'] = '<sip:(.*)>'
            ereg['search_in'] = 'hdr'
            ereg['header'] = 'To:'
            ereg['assign_to'] = 'dummy,local_addr'
          end
          action << doc.create_element('assignstr') do |assignstr|
            assignstr['assign_to'] = "call_addr"
            assignstr['value']     = "[$local_addr]"
          end
        end
        recv << action
      end
      # These variables (except dummy) will only be used if we initiate a hangup
      @reference_variables += %w(dummy remote_addr remote_tag local_addr call_addr)
    end
294926
public static function processMessage ($msg)
  {
    $msg = preg_replace_callback ('#<path>([^<]*)</path>#', function ($m) {
      return ErrorConsole::errorLink ($m[1], 1, 1, self::shortFileName ($m[1]));
    }, $msg);
    return $msg;
  }
847992
public function parseLine($msg)
    {
        if (!strncmp($msg, ':', 1)) {
            $pos    = strcspn($msg, ' ');
            $origin = (string) substr($msg, 1, $pos - 1);
            $msg    = new \Erebot\IrcTextWrapper((string) substr($msg, $pos + 1));
        } else {
            /// @FIXME the RFCs say we should assume origin = server instead.
            $origin = '';
            $msg    = new \Erebot\IrcTextWrapper($msg);
        }

        $type   = $msg[0];
        $type   = strtoupper($type);
        unset($msg[0]);

        $method = 'handle'.$type;
        $exists = method_exists($this, $method);
        // We need a backup for numeric events
        // as the method may alter the message.
        $backup = clone $msg;

        if ($exists) {
            $res = $this->$method($origin, $msg);
        }

        if (ctype_digit($type)) {
            // For numeric events, the first token is always the target.
            $target = $backup[0];
            unset($backup[0]);
            return $this->connection->dispatch(
                $this->makeEvent(
                    '!Numeric',
                    intval($type, 10),
                    $origin,
                    $target,
                    $backup
                )
            );
        }

        if ($exists) {
            return $res;
        }

        /// @TODO: logging
        return false;
    }
1255184
function message_part_after($args)
    {
        if ($args['type'] == 'plain') {
            $this->load_config();

            $rcube = rcube::get_instance();
            if (!$rcube->config->get('emoticons_display', false)) {
                return $args;
            }

            require_once __DIR__ . '/emoticons_engine.php';

            $args['body'] = emoticons_engine::text2icons($args['body']);
        }

        return $args;
    }
102548
protected function handleNICK($origin, $msg)
    {
        // :oldnick!ident@host NICK newnick
        return $this->connection->dispatch(
            $this->makeEvent('!Nick', $origin, $msg[0])
        );
    }
1174490
protected function validateOrigin($origin, $allowedOrigins)
    {
        if (empty($allowedOrigins) || empty($origin)) {
            return false;
        }
        foreach ($allowedOrigins as $allowedOrigin) {
            if ($allowedOrigin === '*') {
                return true;
            }
            if (strcasecmp($allowedOrigin, $origin) === 0) {
                return true;
            }
        }
        return false;
    }
918128
public function add($origin, $name, array $params = array()) {
        if (!$this->exists($name)) {
            $field = new Garp_Spawn_Field($origin, $name, $params);
            if ($origin === 'default')
                array_unshift($this->_fields, $field);
            else
                $this->_fields[] = $field;
        }
        else throw new Exception("The '{$name}' field is already registered for this model.");
    }
189453
public function call( array$origin_params ):array
	{
		$params= $this->request_transformer->transform( $origin_params );

		$response= HTTP::url( $this->makeUrl( $params ) )
			->method( $this->method )
			->headers( $params['headers']??[] )
			->header( 'Accept', $this->response_content_type )
			->header( 'Content-Type', $this->request_content_type )
			->send( $this->makeBody( $params['body']??null ) )
		;

		return $this->parseResponse( $response );
	}
46757
protected function processPpcRun($message)
    {
        $result = $this->processPpcRunHelp($message);
        if (!$message['oneWay']) {
            $newMessage['result'] = $result;
            $newMessage['token'] = $message['token'];
            $data = get_instance()->packServerMessageBody(SwooleMarco::PROCESS_RPC_RESULT, $newMessage);
            $this->sendMessage($data, $message['worker_id']);
        }
    }
670412
private function prepareRequest(MessageInterface $message, RecipientInterface $recipient) {
        if (!$this->getApiKey()) {
            throw new \RuntimeException("No API Key provided.");
        }

        $uri = new Uri($recipient->getEndpoint());
        return Pusher::createStandardRequest($message, $recipient)
            ->withUri($uri)
            ->withHeader('Authorization', sprintf('key=%s', $this->getApiKey()));
    }
1316712
public static function groupPrefix(string $prefix, $origin, $target = null)
    {
        $target = is_object($target) ? (object) $target : (array) $target;

        foreach ((array) $origin as $key => $row) {
            if (strpos($key, $prefix) === 0) {
                $key2 = Mbstring::substr($key, Mbstring::strlen($prefix));
                $target = Arr::set($target, $key2, $row);
            }
        }

        return $target;
    }
128796
protected function handleKICK($origin, $msg)
    {
        // :nick1!ident@host KICK #chan nick2 :Reason
        return $this->connection->dispatch(
            $this->makeEvent('!Kick', $msg[0], $origin, $msg[1], $msg[2])
        );
    }
893068
public function onMessage(ConnectionInterface $from, $msg) {
        $from = $this->connections[$from];

        if (null === ($json = @json_decode($msg, true))) {
            throw new JsonException;
        }

        if (!is_array($json) || $json !== array_values($json)) {
            throw new Exception("Invalid WAMP message format");
        }

        if (isset($json[1]) && !(is_string($json[1]) || is_numeric($json[1]))) {
            throw new Exception('Invalid Topic, must be a string');
        }

        switch ($json[0]) {
            case static::MSG_PREFIX:
                $from->WAMP->prefixes[$json[1]] = $json[2];
            break;

            case static::MSG_CALL:
                array_shift($json);
                $callID  = array_shift($json);
                $procURI = array_shift($json);

                if (count($json) == 1 && is_array($json[0])) {
                    $json = $json[0];
                }

                $this->_decorating->onCall($from, $callID, $from->getUri($procURI), $json);
            break;

            case static::MSG_SUBSCRIBE:
                $this->_decorating->onSubscribe($from, $from->getUri($json[1]));
            break;

            case static::MSG_UNSUBSCRIBE:
                $this->_decorating->onUnSubscribe($from, $from->getUri($json[1]));
            break;

            case static::MSG_PUBLISH:
                $exclude  = (array_key_exists(3, $json) ? $json[3] : null);
                if (!is_array($exclude)) {
                    if (true === (boolean)$exclude) {
                        $exclude = [$from->WAMP->sessionId];
                    } else {
                        $exclude = [];
                    }
                }

                $eligible = (array_key_exists(4, $json) ? $json[4] : []);

                $this->_decorating->onPublish($from, $from->getUri($json[1]), $json[2], $exclude, $eligible);
            break;

            default:
                throw new Exception('Invalid WAMP message type');
        }
    }
664466
def process(data)
      message = MultiJson.load(data, symbolize_keys: true)
      event   = message[:event]

      PusherFake.log("RECV #{id}: #{message}")

      if event.start_with?(CLIENT_EVENT_PREFIX)
        process_trigger(event, message)
      else
        process_event(event, message)
      end
    end
517077
private void addMessage(ValidationMessage<Origin> message) {
		if (message == null) {
			return;
		}
		
		if( null != defaultOrigin ) {
			message.addOrigin( defaultOrigin );
		}
		
		this.messages.add(message);
	}