From 9e955eb3c37212d403a9a6e97fcb91f30fc9b6b1 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Sun, 3 Jun 2018 14:43:15 +0200
Subject: MUC: Use xml:lang from stanza that creates a room as default for
 language

---
 plugins/muc/mod_muc.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 7be8c2d3..675bd9d5 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -292,7 +292,7 @@ module:hook("muc-room-pre-create", function (event)
 	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)
-- 
cgit v1.2.3