Destroy room when moderator leaves

APP.conference.listMembers(); this will give all the members list

setTimeout(() => {
get member list
if i am moderator then
chcek if someone in member list is a moderator?
if no moderator force leave
}, 60000)
we dont use refresh browser anymore, instead we execute APP.conference.hangup(); so it will force you leave the room.

I am new to jitsi.

Should we put this code like below?

create a new .lua file then add the code above.
In /etc/prosody/conf.d/ add the directory path of your .lua file :
plugin_paths = { "/usr/share/jitsi-meet/prosody-plugins/","/DIRECTORY/PATH/OF/YOUR/FILE"}

Or I need to find the conference.js file and change it.

I am currently running a self hosted jitsi server on ubutnu 20.04 LTS

If this helps, replace in conference.js line 1988, the entire USER_LEFT function with the following:

room.on(JitsiConferenceEvents.USER_LEFT, (id, user) => {
            // The logic shared between RN and web.
            commonUserLeftHandling(, room, user);

            // if user is a moderator, kick everyone out
            if(user.isModerator) {
                let participants = APP.conference.listMembers();
                participants.forEach(participant => {
          , participant));

            if (user.isHidden()) {

            logger.log(`USER ${id} LEFT:`, user);


If the user is a moderator and has left the conference, it will kick each individual participant out and close the room.

1 Like

I could not find out this conference.js file.In which location this file available

This is in the source code itself. You’ll have to compile it ( to access it.

i am new to jitsi, im trying to implement this function with this sample code, but unfortunately it made all (moderator or normal participant) leave room, eventough just normal participant leave the room. any concern that must been check before implement this function ?

sorry for my bad grammar…

It checks if the user is a Moderator and then kicks all the users out if the Moderator leaves.

but if user role is participant, it still kick all of user ( including moderator ). is there any config that i missed ? Now, anyone who leave the room will kick all user in that room.

Unless I’m missing something, the condition is in only if the user is a moderator - it will get a list of all members, including the moderator, and kick everyone out. It doesn’t kick everyone out if the user isn’t a moderator

 if(user.isModerator) { // only gets list and kicks everyone out if the user who leaves is a moderator?

the value of user.isModerator is function (not boolean), so thats why im getting all of user who leave the room will kick all the participant, whether he is moderator / participant. so i make a little adjustment like this :

        if(user._role === 'moderator') {  
               let participants = APP.conference.listMembers();
               participants.forEach(participant => {
         , participant));
                   document.location.href="/";  // i add this for reloading page, since it make user stuck in hidden room after kicked

and now its work perfectly, thanks hybridemitum !!


Sorry for asking basic questions but do I need to compile the whole conference.js by replacing just the code you mentioned above?

I am using a testing virtual machine with 4gb ram and 4 cores with ubuntu 18.04 LTS, will it be enough for testing prosody secure domain authentication and developers mode also on same vm at the same time?


I found file in /etc/jitsi/meet folder.

Do I need to paste the above code in this file and then just run the following:
npm install

Or I need to do anything else?

Please guide.

This project is for a government healthcare institute it will effect thousands or even lakhs of patients who cannot come to the hospital due to covid lockdown restrictions.

Yes. Any time you make source code changes, you have to compile and then create the debian package (just follow the link above).

I don’t see why not.

No, you need to paste it in the actual conference.js, which you have to get the source code to do. Then you will run make.


Thank you for the replies.

I will try it on this testing server.

I installed jitsi meet and it is working fine with secure domain by using the quick-install official guide of jitsi.
If I clone jitsi-meet from git repository on a different virtual machine and then make changes in conference.js, then also do I need to implement secure domain for prosody sperately?

I just want to clarify that installing from git repo and installing from apt repo are totally independent ways of installing or not?

You can use , fully deployed , FREE to use, hosted in India. Uses Jitsi Video Bridge., With password protected rooms, waiting room etc.



We are not allowed to send any of our institutional data to go outside our institute.
If that was the case we could have easily used the commercial softwares.
We need to deploy it within our campus.

@harish_123456 can help you custom deliver the Jitsi solution in your premises.

I believe so, yes.Since it’s on a different virtual machine.

Yes, I believe so.

Thank you @hybridemitum

I get the following error while installing from git repo

user@consult:~/jitsi-meet$ sudo npm install
[sudo] password for user:
npm WARN deprecated @atlaskit/analytics-next-types@3.2.0: Typescript type definition files are now hosted directly from @atlaskit/analytics-next
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! Linux 4.15.0-112-generic
npm ERR! argv “/usr/bin/node” “/usr/bin/npm” “install”
npm ERR! node v8.10.0
npm ERR! npm v3.5.2

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror

npm ERR! Please include the following file with any support request:
npm ERR! /home/aiims/jitsi-meet/npm-debug.log

Solved it.

version problems in npm and nodejs