From b11126a19dbaadf4c32fb8dbec22754ad0712c26 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 8 Dec 2013 20:14:12 +0100 Subject: Provide a JID for IRC users, and add a stringprep dependency for this --- src/xmpp/jid.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/xmpp/jid.hpp') diff --git a/src/xmpp/jid.hpp b/src/xmpp/jid.hpp index 3027497..b6975a2 100644 --- a/src/xmpp/jid.hpp +++ b/src/xmpp/jid.hpp @@ -22,5 +22,15 @@ private: Jid& operator=(Jid&&) = delete; }; +/** + * Prepare the given UTF-8 string according to the XMPP node stringprep + * identifier profile. This is used to send properly-formed JID to the XMPP + * server. + * + * If the stringprep library is not found, we return an empty string. When + * this function is used, the result must always be checked for an empty + * value, and if this is the case it must not be used as a JID. + */ +std::string jidprep(const std::string& original); #endif // JID_INCLUDED -- cgit v1.2.3