about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common.c9
-rw-r--r--src/common.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/common.c b/src/common.c
index 772e24d3..4fa45608 100644
--- a/src/common.c
+++ b/src/common.c
@@ -57,6 +57,8 @@ struct curl_data_t
     size_t size;
 };
 
+static unsigned long unique_id = 0;
+
 static size_t _data_callback(void *ptr, size_t size, size_t nmemb, void *data);
 
 // taken from glib 2.30.3
@@ -469,7 +471,6 @@ xdg_get_data_home(void)
 char *
 create_unique_id(char *prefix)
 {
-    static unsigned long unique_id;
     char *result = NULL;
     GString *result_str = g_string_new("");
 
@@ -485,6 +486,12 @@ create_unique_id(char *prefix)
     return result;
 }
 
+void
+reset_unique_id(void)
+{
+    unique_id = 0;
+}
+
 char *
 p_sha1_hash(char *str)
 {
diff --git a/src/common.h b/src/common.h
index 9521a701..c1aa532d 100644
--- a/src/common.h
+++ b/src/common.h
@@ -127,6 +127,7 @@ contact_presence_t contact_presence_from_resource_presence(resource_presence_t r
 
 char * p_sha1_hash(char *str);
 char * create_unique_id(char *prefix);
+void reset_unique_id(void);
 
 int cmp_win_num(gconstpointer a, gconstpointer b);
 int get_next_available_win_num(GList *used);