5. Configuration
To enable Tigase MUC Component you need to add following block to etc/init.properties
file:
muc () {
}
It will enable component and configure it under name muc
. By default it will also use database configured as default
data source to store data - including room configuration, affiliations and chat history.
5.1. Using separate storage
As mentioned above, by default Tigase MUC component uses default
data source configured for Tigase XMPP Server. It is possible to use separate store by MUC component. To do so you need to configure new DataSource
in dataSource
section. Here we will use muc-store
as name of newly configured data source. Additionally you need to pass name of newly configured data source to dataSourceName
property of default
DAO of MUC component.
dataSource {
muc-store () {
uri = 'jdbc:postgresql://server/muc-database'
}
}
muc () {
muc-dao {
default () {
dataSourceName = 'muc-store'
}
}
}
It is also possible to configure separate store for particular domain, ie. muc.example.com
. Here we will configure data source with name muc.example.com
and use it to store data for MUC rooms hosted at muc.example.com
:
dataSource {
'muc.example.com' () {
uri = 'jdbc:postgresql://server/example-database'
}
}
muc () {
muc-dao {
'muc.example.com' () {
# we may not set dataSourceName as it matches name of domain
}
}
}
Note
With this configuration room data for other domains than example.com will be stored in default data source.
5.2. Configuring default room configuration
It is possible to define value for every room option by setting it’s value to defaultRoomConfig
as a property:
muc () {
defaultRoomConfig {
<option> = <value>
}
}
for example:
muc () {
defaultRoomConfig {
'tigase#presence_delivery_logic' = 'PREFERE_LAST'
}
}
5.3. Enabling and configuring MUC room logging
MUC component supports logging inforamtions about
joining room
leaving room
broadcasting message by room
setting room chat subject
to HTML, XML or plain text files.
To enable this functionality you need to modify etc/init.properties
file to enable muc-logger
in MUC component, like this:
muc () {
muc-logger () {
}
}
By default files are stored in logs
subdirectory of Tigase XMPP Server installation directory. You may change it by setting room-log-directory
property of MUC component to path where you want to store room logs.
muc () {
'muc-logger' () {
}
'room-log-directory' = '/var/log/muc/'
}
We provide default logger for room events, but if you want, you may set your own custom logger. Here we set com.example.CustomLogger
as logger for MUC rooms:
muc () {
'muc-logger' (class: com.example.CustomLogger) {
}
}
5.4. Disable message filtering
MUC component by default filters messages and allows only <body/>
element to be delivered to participants. To disable this filtering it is required to set message-filter-enabled
property of MUC component to false
.
muc () {
'message-filter-enabled' = false
}
5.5. Disable presence filtering
To disable filter and allow MUC transfer all subelements in <presence/>, presence-filter-enabled
property of MUC component needs to be set to false
muc () {
'presence-filter-enabled' = false
}
5.6. Configuring discovering of disconnected participants
MUC component automatically discovers disconnected participants by checking if user is still connected every 5 minutes.
It is possible to increase checking frequency by setting search-ghosts-every-minute
property of MUC component to true
muc () {
'search-ghosts-every-minute' = trues
}
It is also possible to disable this discovery by setting ghostbuster-enabled
property of MUC component to false
muc () {
'ghostbuster-enabled' = false
}
5.7. Allow chat states in rooms
To allow transfer of chat-states in MUC messages set muc-allow-chat-states
property of MUC component to true
muc () {
'muc-allow-chat-states' = true
}
5.8. Disable locking of new rooms
To turn off default locking newly created rooms set muc-lock-new-room
property of MUC component to `false’ by default new room will be locked until owner submits a new room configuration.
muc () {
'muc-lock-new-room' = false
}
5.9. Disable joining with multiple resources under same nickname
To disable joining from multiple resources under single nickname set muc-multi-item-allowed
property of MUC component to false
muc () {
'muc-multi-item-allowed' = false
}
5.10. Enabling support for XEP-0091: Legacy Delayed Delivery
To enable support for XEP-0091 you need to set legacy-delayed-delivery-enabled
property of MUC component to true
muc () {
'legacy-delayed-delivery-enabled' = true
}
5.11. Limiting who can create room
For public installations it’s desirable to limit visibility of the room - only domain administrators should be able to create publicly visible room that can be discovered by anyone. Everyone else should only be able to create private rooms. This was implemented in https://projects.tigase.net/issue/muc-133.
The feature is configurable via two options: hidden-room-creation-acl and public-room-creation-acl and follow ACL options defined for Tigase Server (https://docs.tigase.net/projects/tigase-tigase-mix/en/latest/Configuration.html#setting-acl)
muc () {
mucConfig () {
'hidden-room-creation-acl' = DOMAIN
'public-room-creation-acl' = DOMAIN_ADMIN
}
}