From 9500bfd4ccb21b261fd8204180d78553704f7acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Sun, 18 Mar 2018 19:33:07 +0100 Subject: Reflect message IDs in channel MUCs fix #3283 --- src/utils/uuid.cpp | 14 ++++++++++++++ src/utils/uuid.hpp | 8 ++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/utils/uuid.cpp create mode 100644 src/utils/uuid.hpp (limited to 'src/utils') diff --git a/src/utils/uuid.cpp b/src/utils/uuid.cpp new file mode 100644 index 0000000..23b71fe --- /dev/null +++ b/src/utils/uuid.cpp @@ -0,0 +1,14 @@ +#include +#include + +namespace utils +{ +std::string gen_uuid() +{ + char uuid_str[37]; + uuid_t uuid; + uuid_generate(uuid); + uuid_unparse(uuid, uuid_str); + return uuid_str; +} +} diff --git a/src/utils/uuid.hpp b/src/utils/uuid.hpp new file mode 100644 index 0000000..d550475 --- /dev/null +++ b/src/utils/uuid.hpp @@ -0,0 +1,8 @@ +#pragma once + +#include + +namespace utils +{ +std::string gen_uuid(); +} -- cgit v1.2.3