# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1528029795 -7200
# Node ID b9e56f46916e0fa453ed4cfeced233cf053ee891
# Parent  c601c834bf015f1a10182415ab3d78d8ae48bcce
MUC: Use xml:lang from stanza that creates a room as default for language

diff -r c601c834bf01 -r b9e56f46916e plugins/muc/mod_muc.lua
--- a/plugins/muc/mod_muc.lua	Sun Jun 03 14:43:06 2018 +0200
+++ b/plugins/muc/mod_muc.lua	Sun Jun 03 14:43:15 2018 +0200
@@ -292,7 +292,7 @@
 	room:set_whois(module:get_option_boolean("muc_rooom_default_public_jids", room:get_whois() == "anyone") and "anyone" or "moderators");
 	room:set_changesubject(module:get_option_boolean("muc_rooom_default_change_subject", room:get_changesubject()));
 	room:set_historylength(module:get_option_number("muc_room_default_history_length", room:get_historylength()));
-	room:set_language(module:get_option_string("muc_room_default_language"));
+	room:set_language(event.stanza.attr["xml:lang"] or module:get_option_string("muc_room_default_language"));
 end, 1);
 
 module:hook("muc-room-pre-create", function(event)