summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src/tox_utils.cpp')
-rw-r--r--protocols/Tox/src/tox_utils.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp
index 6745bedb71..5964177965 100644
--- a/protocols/Tox/src/tox_utils.cpp
+++ b/protocols/Tox/src/tox_utils.cpp
@@ -125,6 +125,15 @@ std::string CToxProto::DataToHexString(std::vector<uint8_t> data)
return oss.str();
}
+std::string CToxProto::ToxAddressToId(std::string address)
+{
+ if (address.length() > TOX_CLIENT_ID_SIZE * 2)
+ {
+ address.erase(address.begin() + TOX_CLIENT_ID_SIZE * 2, address.end());
+ }
+ return address;
+}
+
bool CToxProto::IsFileExists(std::tstring path)
{
//return ::GetFileAttributes(fileName) != DWORD(-1)