| Index: remoting/signaling/jid_util.cc
|
| diff --git a/remoting/signaling/jid_util.cc b/remoting/signaling/jid_util.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8e8e12bb8788da5d03eb93f8046d190907c03caf
|
| --- /dev/null
|
| +++ b/remoting/signaling/jid_util.cc
|
| @@ -0,0 +1,23 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "remoting/signaling/jid_util.h"
|
| +
|
| +#include "base/strings/string_util.h"
|
| +
|
| +namespace remoting {
|
| +
|
| +std::string NormalizeJid(const std::string& jid) {
|
| + size_t slash_pos = jid.find('/');
|
| +
|
| + // In case there the jid doesn't have resource id covert the whole value to
|
| + // lower-case.
|
| + if (slash_pos == std::string::npos)
|
| + return base::StringToLowerASCII(jid);
|
| +
|
| + return base::StringToLowerASCII(jid.substr(0, slash_pos)) +
|
| + jid.substr(slash_pos);
|
| +}
|
| +
|
| +} // namespace remoting
|
|
|