Files
@ 34ec0df769f1
Branch filter:
Location: libtransport.git/include/Swiften/Server/SimpleUserRegistry.cpp - annotation
34ec0df769f1
763 B
text/x-c++hdr
avoid WTF-8.
what arrives from XMPP is already UTF-8 encoded, so applying UTF-8 again
produces somewhat unfortunate results.
this line is not always necessary. before this change, the code was
dependent on the locale.
what arrives from XMPP is already UTF-8 encoded, so applying UTF-8 again
produces somewhat unfortunate results.
this line is not always necessary. before this change, the code was
dependent on the locale.
828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 c7f2b6298073 828ae9d2cb88 c7f2b6298073 c7f2b6298073 c7f2b6298073 c7f2b6298073 c7f2b6298073 c7f2b6298073 c7f2b6298073 c7f2b6298073 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 828ae9d2cb88 | /*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include <Swiften/Server/SimpleUserRegistry.h>
namespace Swift {
SimpleUserRegistry::SimpleUserRegistry() {
}
void SimpleUserRegistry::isValidUserPassword(const JID& user, ServerFromClientSession *session, const SafeByteArray& password) {
std::map<JID,SafeByteArray>::const_iterator i = users.find(user);
if (i != users.end() && i->second == password) {
session->handlePasswordValid();
}
else {
session->handlePasswordInvalid();
}
}
void SimpleUserRegistry::addUser(const JID& user, const std::string& password) {
users.insert(std::make_pair(user, createSafeByteArray(password)));
}
}
|