aboutsummaryrefslogtreecommitdiff
path: root/src/Group.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-03-11 00:12:37 +0100
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commit6099ec04bd0d98b9e75f5b55b1215c94ccf20202 (patch)
tree9a551e8e723cde057610d6071587bc76b4a6af19 /src/Group.cpp
parent0e62cb8e5ed06d906ad84321cdda22acfcc952c9 (diff)
Add operation to allow users to be added to group
WARNING! Lazy implementation everywhere, does not handle out-of-order packets
Diffstat (limited to 'src/Group.cpp')
-rw-r--r--src/Group.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Group.cpp b/src/Group.cpp
index 93a0688..12b50ed 100644
--- a/src/Group.cpp
+++ b/src/Group.cpp
@@ -1,15 +1,18 @@
#include "../include/Group.hpp"
#include "../include/User.hpp"
+#include <cstring>
using namespace std;
namespace odhtdb
{
- Group::Group(const string &_name) :
- name(_name)
+ Group::Group(const string &_name, uint8_t _id[16], const Permission &_permission) :
+ name(_name),
+ permission(_permission)
{
if(name.size() > 255)
throw GroupNameTooLongException(name);
+ memcpy(id, _id, 16);
}
Group::~Group()
@@ -26,6 +29,16 @@ namespace odhtdb
{
return name;
}
+
+ DataView Group::getId() const
+ {
+ return { (void*)id, 16 };
+ }
+
+ const Permission& Group::getPermission() const
+ {
+ return permission;
+ }
const vector<const User*>& Group::getUsers() const
{