Messages coming from the IRC server are of type "chat"
This commit is contained in:
@@ -188,7 +188,7 @@ void Bridge::send_message(const Iid& iid, const std::string& nick, const std::st
|
|||||||
this->make_xmpp_body(body), this->user_jid);
|
this->make_xmpp_body(body), this->user_jid);
|
||||||
else
|
else
|
||||||
this->xmpp->send_message(iid.chan + "%" + iid.server,
|
this->xmpp->send_message(iid.chan + "%" + iid.server,
|
||||||
this->make_xmpp_body(body), this->user_jid);
|
this->make_xmpp_body(body), this->user_jid, "chat");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bridge::send_muc_leave(Iid&& iid, std::string&& nick, const std::string& message, const bool self)
|
void Bridge::send_muc_leave(Iid&& iid, std::string&& nick, const std::string& message, const bool self)
|
||||||
@@ -220,7 +220,7 @@ void Bridge::send_xmpp_message(const std::string& from, const std::string& autho
|
|||||||
body = std::string("[") + author + std::string("] ") + msg;
|
body = std::string("[") + author + std::string("] ") + msg;
|
||||||
else
|
else
|
||||||
body = msg;
|
body = msg;
|
||||||
this->xmpp->send_message(from, this->make_xmpp_body(body), this->user_jid);
|
this->xmpp->send_message(from, this->make_xmpp_body(body), this->user_jid, "chat");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bridge::send_user_join(const std::string& hostname,
|
void Bridge::send_user_join(const std::string& hostname,
|
||||||
|
|||||||
@@ -457,11 +457,13 @@ void* XmppComponent::get_receive_buffer(const size_t size) const
|
|||||||
return this->parser.get_buffer(size);
|
return this->parser.get_buffer(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, const std::string& to)
|
void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, const std::string& to, const std::string& type)
|
||||||
{
|
{
|
||||||
XmlNode node("message");
|
XmlNode node("message");
|
||||||
node["to"] = to;
|
node["to"] = to;
|
||||||
node["from"] = from + "@" + this->served_hostname;
|
node["from"] = from + "@" + this->served_hostname;
|
||||||
|
if (!type.empty())
|
||||||
|
node["type"] = type;
|
||||||
XmlNode body_node("body");
|
XmlNode body_node("body");
|
||||||
body_node.set_inner(std::get<0>(body));
|
body_node.set_inner(std::get<0>(body));
|
||||||
body_node.close();
|
body_node.close();
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Send a message from from@served_hostname, with the given body
|
* Send a message from from@served_hostname, with the given body
|
||||||
*/
|
*/
|
||||||
void send_message(const std::string& from, Xmpp::body&& body, const std::string& to);
|
void send_message(const std::string& from, Xmpp::body&& body,
|
||||||
|
const std::string& to, const std::string& type);
|
||||||
/**
|
/**
|
||||||
* Send a join from a new participant
|
* Send a join from a new participant
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user