Comparison

plugins/muc/mod_muc.lua @ 8868:b9e56f46916e

MUC: Use xml:lang from stanza that creates a room as default for language
author Kim Alvefur <zash@zash.se>
date Sun, 03 Jun 2018 14:43:15 +0200
parent 8867:c601c834bf01
child 8869:7277797a4988
comparison
equal deleted inserted replaced
8867:c601c834bf01 8868:b9e56f46916e
290 room:set_members_only(module:get_option_boolean("muc_rooom_default_members_only", room:get_members_only())); 290 room:set_members_only(module:get_option_boolean("muc_rooom_default_members_only", room:get_members_only()));
291 room:set_moderated(module:get_option_boolean("muc_rooom_default_moderated", room:get_moderated())); 291 room:set_moderated(module:get_option_boolean("muc_rooom_default_moderated", room:get_moderated()));
292 room:set_whois(module:get_option_boolean("muc_rooom_default_public_jids", room:get_whois() == "anyone") and "anyone" or "moderators"); 292 room:set_whois(module:get_option_boolean("muc_rooom_default_public_jids", room:get_whois() == "anyone") and "anyone" or "moderators");
293 room:set_changesubject(module:get_option_boolean("muc_rooom_default_change_subject", room:get_changesubject())); 293 room:set_changesubject(module:get_option_boolean("muc_rooom_default_change_subject", room:get_changesubject()));
294 room:set_historylength(module:get_option_number("muc_room_default_history_length", room:get_historylength())); 294 room:set_historylength(module:get_option_number("muc_room_default_history_length", room:get_historylength()));
295 room:set_language(module:get_option_string("muc_room_default_language")); 295 room:set_language(event.stanza.attr["xml:lang"] or module:get_option_string("muc_room_default_language"));
296 end, 1); 296 end, 1);
297 297
298 module:hook("muc-room-pre-create", function(event) 298 module:hook("muc-room-pre-create", function(event)
299 local origin, stanza = event.origin, event.stanza; 299 local origin, stanza = event.origin, event.stanza;
300 if not track_room(event.room) then 300 if not track_room(event.room) then