code: public void invite(String sessionId, Collection<IPublisherInfo> invitees, boolean cancel) {
          if (invitees == null || invitees.isEmpty()) {
              return;
          }
          
          List<Recipient> recipients = new ArrayList<>();
          
          for (IPublisherInfo invitee : invitees) {
              recipients.add(new Recipient(RecipientType.SESSION, invitee.getSessionId()));
          }
          
          String eventData = sessionId + (cancel ? "" : "^" + self.getUserName());
          Recipient[] recips = new Recipient[recipients.size()];
          eventManager.fireRemoteEvent(EVENT_INVITE, eventData, recipients.toArray(recips));
      }
docs: Sends an invitation request to the specified invitees.
  
  @param sessionId The id of the chat session making the invitation.
  @param invitees The list of invitees. This will be used to constraint delivery of the
  invitation event to only those subscribers.
  @param cancel If true, invitees are sent a cancellation instead.