Notifies about an existing chatroom being attached to an event.

    :param room: the chatroom
    :param event: the event
    :param user: the user performing the action
196225
def notify_attached(room, event, user):
    
    tpl = get_plugin_template_module('emails/attached.txt', chatroom=room, event=event, user=user)
    _send(event, tpl)
1198055
function(user) {
      if (!this._shouldAllowUser(user)) {
        return false;
      }
      user.leaveRoom();
      this.members.push(user);
      user.room = this;
      if (this.minRoomMembers !== null &&
          this.members.length >= this.minRoomMembers) {
        this._hasReachedMin = true;
      }
      this._emitEvent('newMember', this, user);
      this._serverMessageMembers(this.isLobby ? 'lobbyMemberJoined' : 'roomMemberJoined', _.pick(user, 'id', 'name'));
      user._serverMessage('joinedRoom', _.pick(this, 'name'));
      return true;
    }
282655
function(self, eventType, content) {
    return self.client.sendEvent(self.roomId, eventType, content);
}
297585
def chat(room=None, stream=None, **kwargs):
    
    if room is None:
        room = _random_room()
        print("room =", room)
    if stream is None:
        stream = CameraStream()
    room = WebRTCRoomMqtt(stream=stream, room=room)
    box = widgets.HBox(children=[])
    widgets.jslink((room, 'streams'), (box, 'children'))
    display(box)
    return room
1194989
function(room) {
        this.rooms[room.roomId] = room;
        // add listeners for room member changes so we can keep the room member
        // map up-to-date.
        room.currentState.on("RoomState.members", this._onRoomMember.bind(this));
        // add existing members
        const self = this;
        room.currentState.getMembers().forEach(function(m) {
            self._onRoomMember(null, room.currentState, m);
        });
    }
919802
def _handle_chat(self, data):
        """"""

        self.conn.enqueue_data(
            "chat", ChatMessage.from_data(self.room, self.conn, data)
        )
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)
285836
def on_invite(self, connection, event):
        
        sender = self.get_nick(event.source)
        invited = self.get_nick(event.target)
        channel = event.arguments[0]

        if invited == self._nickname:
            logging.info("! I am invited to %s by %s", channel, sender)
            connection.join(channel)

        else:
            logging.info(">> %s invited %s to %s", sender, invited, channel)
1304216
def update_room(room):
    """"""

    if room.custom_server:
        return

    def _update_room(xmpp):
        muc = xmpp.plugin['xep_0045']
        muc.joinMUC(room.jid, xmpp.requested_jid.user)
        muc.configureRoom(room.jid, _set_form_values(xmpp, room, muc.getRoomConfig(room.jid)))

    current_plugin.logger.info('Updating room %s', room.jid)
    _execute_xmpp(_update_room)
202983
def join_room(self, room_name):   
             
        logging.debug('Joining room {ro}'.format(ro=room_name))

        for room in self.rooms:
            if room.name == room_name:
                room.add_user(self)
                self._rooms[room_name] = room
                room.welcome(self)
                break
        else:
            room = Room(room_name)
            self.rooms.append(room)
            self._rooms[room_name] = room
            room.add_user(self)
622678
def process_invite(room, event)
      sender = get_user(event['sender'])
      invitee = get_user(event['state_key'])
      invitee.process_invite room, sender, event
    end
205998
def publishToOther(self, roomId, name, data):
        
        tmpList = self.getRoom(roomId)
        # Select everybody except me
        userList = [x for x in tmpList if x is not self]
        self.publishToRoom(roomId, name, data, userList)
653766
def _process_event(self, event):
        
        if event.get('user'):
            event.user = self.lookup_user(event.get('user'))

        if event.get('channel'):
            event.channel = self.lookup_channel(event.get('channel'))

        if self.user.id in event.mentions:
            event.mentions_me = True

        event.mentions = [ self.lookup_user(uid) for uid in event.mentions ]

        return event
13648
def notify_event(self, session_info, topic):
        
        try:
            self.event_bus.sendMessage(topic, items=session_info)
        except AttributeError:
            msg = "Could not publish {} event".format(topic)
            raise AttributeError(msg)
23036
def promote_chat_member(self, *args, **kwargs):
        """"""
        return promote_chat_member(*args, **self._merge_overrides(**kwargs)).run()
1353278
def invite(user, reason='')
      response = self.class.post(@api.invite_config[:url]+"/#{user}",
        :query => { :auth_token => @token },
        :body => {
          :reason => reason
        }.to_json,
        :headers => @api.headers)

      ErrorHandler.response_code_to_exception_for :room, room_id, response
      true
    end
740942
def emit(self, event, data=None, room=None, skip_sid=None, namespace=None,
             callback=None):
        
        return self.server.emit(event, data=data, room=room, skip_sid=skip_sid,
                                namespace=namespace or self.namespace,
                                callback=callback)