summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/sametime/clist_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/!NotAdopted/sametime/clist_util.cpp')
-rw-r--r--plugins/!NotAdopted/sametime/clist_util.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/sametime/clist_util.cpp b/plugins/!NotAdopted/sametime/clist_util.cpp
new file mode 100644
index 0000000000..013f38d144
--- /dev/null
+++ b/plugins/!NotAdopted/sametime/clist_util.cpp
@@ -0,0 +1,23 @@
+#include "clist_util.h"
+
+int GroupNameExists(const char *name, int skipGroup)
+{
+ char idstr[33];
+ DBVARIANT dbv;
+ int i;
+
+ for (i = 0;; i++) {
+ if (i == skipGroup)
+ continue;
+ itoa(i, idstr, 10);
+ if (DBGetContactSettingStringUtf(NULL, "CListGroups", idstr, &dbv))
+ break;
+ if (strcmp(dbv.pszVal + 1, name) == 0) {
+ DBFreeVariant(&dbv);
+ return i + 1;
+ }
+ DBFreeVariant(&dbv);
+ }
+ return 0;
+}
+