Parse an INVITE and dispatch an event.
509105
def _parse_invite(client, command, actor, args):
    """"""
    target, _, channel = args.rpartition(" ")
    client.dispatch_event("INVITE", actor, target, channel.lower())
1369434
public void onInviteEvent(javax.sip.RequestEvent requestEvent,
			ActivityContextInterface aci) {

		final ServerTransaction serverTransaction = requestEvent
				.getServerTransaction();

		try {
			// send "trying" response
			Response response = messageFactory.createResponse(Response.TRYING,
					requestEvent.getRequest());
			serverTransaction.sendResponse(response);
			// get local object
			final SbbLocalObject sbbLocalObject = this.sbbContext
					.getSbbLocalObject();
			
			// send 180
			response = messageFactory.createResponse(Response.RINGING,
					requestEvent.getRequest());
			serverTransaction.sendResponse(response);

			setFinalReplySent(false);
			// set timer of 1 secs on the dialog aci to send 200 OK after that
			timerFacility.setTimer(aci, null,
					System.currentTimeMillis() + 1000L, getTimerOptions());			
						
		} catch (Exception e) {
			getTracer().severe("failure while processing initial invite", e);
		}
	}
96560
def _send_invitation(self, enrollment, event):
        """"""

        self.log('Sending enrollment status mail to user')

        self._send_mail(self.config.invitation_subject, self.config.invitation_mail, enrollment, event)
790188
@Override
    public Object accept(IEvent event, Object param) {
        return eventDispatcher().accept(event, param);
    }
667171
def on_invite(self, data):
        
        if not self._nick:
            self._nick = self.boundjid.user

        # Join the room
        self.plugin["xep_0045"].joinMUC(data["from"], self._nick)
976944
function parseMiddleware(ctx, next) {
      try {
        ctx.event = JSON.parse(ctx.content.toString());
        next();
      } catch (e) {
        throw e;
      }
    }
56586
async def handle_event(self, event: FacebookMessage):
        
        responder = FacebookResponder(self)
        await self._notify(event, responder)
677399
function dispatchEvent (event, data) {
    if (hasDOM()) {
      eventEmitter.dispatchEvent(new CustomEvent(event, data));
    } else if (hasEventEmitter()) {
      eventEmitter.emit(event, data);
    }
  }
911323
public function prePersist(LifecycleEventArgs $args): void
    {
        // Only act on invitation objects.
        $invitation = $args->getObject();
        if (!$invitation instanceof Invitation) {
            return;
        }

        // If the event author is the invitee accept the invitation.
        $event = $invitation->getEvent();
        if ($event->getAuthor() == $invitation->getInvitee()) {
            $invitation->setResponse(Invitation::RESPONSE_ACCEPT);
        }
    }
526499
def dispatchEvent(self, event, *args):
        
        for callback in self.listeners[event]:
            yield callback(event, self, *args)
1226032
function _dispatch(events, data) {
    var i,
        j,
        i_end,
        j_end,
        event,
        eventName,
        eArray = Array.isArray(events) ?
                   events :
                   events.split(/ /);

    data = data === undefined ? {} : data;

    for (i = 0, i_end = eArray.length; i !== i_end; i += 1) {
      eventName = eArray[i];

      if (_handlers[eventName]) {
        event = {
          type: eventName,
          data: data || {}
        };

        for (j = 0, j_end = _handlers[eventName].length; j !== j_end; j += 1)
          try {
            _handlers[eventName][j].handler(event);
          } catch (e) {}
      }
    }
  }
722461
def process_events(events)
      process_join events['join'] if events.key? 'join'
      process_invite events['invite'] if events.key? 'invite'
      process_leave events['leave'] if events.key? 'leave'
    end
28429
public function dispatch()
    {
        if ($this->isDispatchable()) {

            $sorted = [];

            foreach($this->attachedToEvents as $eventName)
            {
                $sorted[$eventName] = $this->dispatchedEvents[$eventName];
            }

            call_user_func($this->listener, $sorted);
            if ($this->purge) {
                $this->dispatchedEvents = [];
            }
        }
    }
622678
def process_invite(room, event)
      sender = get_user(event['sender'])
      invitee = get_user(event['state_key'])
      invitee.process_invite room, sender, event
    end
86899
def accept_invite(invite)
      resolved = invite(invite).code
      API::Invite.accept(token, resolved)
    end
1010897
function dispatchEvent(event) {
    var type = event.type;
    var listeners = this._eventListeners[type] || [];

    for (var i = 0; i < listeners.length; i++) {
      if (typeof listeners[i] == "function") {
        listeners[i].call(this, event);
      } else {
        listeners[i].handleEvent(event);
      }
    }

    return !!event.defaultPrevented;
  }
1374973
def _parse_welcome(client, command, actor, args):
    """"""
    _, _, hostmask = args.rpartition(' ')
    client.user.update_from_hostmask(hostmask)
    client.dispatch_event("WELCOME", hostmask)