1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "remoting/signaling/jid_util.h"
7 #include "base/strings/string_util.h"
11 std::string
NormalizeJid(const std::string
& jid
) {
12 size_t slash_pos
= jid
.find('/');
14 // In case there the jid doesn't have resource id covert the whole value to
16 if (slash_pos
== std::string::npos
)
17 return base::StringToLowerASCII(jid
);
19 return base::StringToLowerASCII(jid
.substr(0, slash_pos
)) +
20 jid
.substr(slash_pos
);
23 } // namespace remoting