From 04d28f968b227067e77e365d317fc251d3c965f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?louiz=E2=80=99?= <louiz@louiz.org>
Date: Tue, 19 Apr 2016 02:43:26 +0200
Subject: Forward the topic authors, handle the author from 333 messages

fix #2
---
 louloulibs/xmpp/xmpp_component.cpp | 7 +++++--
 louloulibs/xmpp/xmpp_component.hpp | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

(limited to 'louloulibs')

diff --git a/louloulibs/xmpp/xmpp_component.cpp b/louloulibs/xmpp/xmpp_component.cpp
index c5906e5..8a0ca52 100644
--- a/louloulibs/xmpp/xmpp_component.cpp
+++ b/louloulibs/xmpp/xmpp_component.cpp
@@ -388,11 +388,14 @@ void XmppComponent::send_invalid_user_error(const std::string& user_name, const
   this->send_stanza(message);
 }
 
-void XmppComponent::send_topic(const std::string& from, Xmpp::body&& topic, const std::string& to)
+void XmppComponent::send_topic(const std::string& from, Xmpp::body&& topic, const std::string& to, const std::string& who)
 {
   XmlNode message("message");
   message["to"] = to;
-  message["from"] = from + "@" + this->served_hostname;
+  if (who.empty())
+    message["from"] = from + "@" + this->served_hostname;
+  else
+    message["from"] = from + "@" + this->served_hostname + "/" + who;
   message["type"] = "groupchat";
   XmlNode subject("subject");
   subject.set_inner(std::get<0>(topic));
diff --git a/louloulibs/xmpp/xmpp_component.hpp b/louloulibs/xmpp/xmpp_component.hpp
index 06236fe..07322dd 100644
--- a/louloulibs/xmpp/xmpp_component.hpp
+++ b/louloulibs/xmpp/xmpp_component.hpp
@@ -124,7 +124,7 @@ public:
   /**
    * Send the MUC topic to the user
    */
-  void send_topic(const std::string& from, Xmpp::body&& xmpp_topic, const std::string& to);
+  void send_topic(const std::string& from, Xmpp::body&& xmpp_topic, const std::string& to, const std::string& who);
   /**
    * Send a (non-private) message to the MUC
    */
-- 
cgit v1.2.3