mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 22:46:22 +00:00
Move ID generation to xmpp folder
create_unique_id() was changed to use UUIDs instead of a counter in the last commit. Since now it depends on connection_create_uuid() which is in the xmpp subfolder the function should also be moved there. Renamed it to connection_create_stanza_id() and moved it to src/xmpp/connection.c. Discussion happened in https://github.com/boothj5/profanity/pull/1010
This commit is contained in:
22
src/common.c
22
src/common.c
@@ -56,7 +56,6 @@
|
||||
#include "log.h"
|
||||
#include "common.h"
|
||||
#include "tools/p_sha1.h"
|
||||
#include "xmpp/xmpp.h"
|
||||
|
||||
struct curl_data_t
|
||||
{
|
||||
@@ -331,27 +330,6 @@ release_is_new(char *found_version)
|
||||
}
|
||||
}
|
||||
|
||||
char*
|
||||
create_unique_id(char *prefix)
|
||||
{
|
||||
char *result = NULL;
|
||||
GString *result_str = g_string_new("");
|
||||
char *uuid = connection_create_uuid();
|
||||
|
||||
if (prefix) {
|
||||
g_string_printf(result_str, "prof_%s_%s", prefix, uuid);
|
||||
} else {
|
||||
g_string_printf(result_str, "prof_%s", uuid);
|
||||
}
|
||||
|
||||
connection_free_uuid(uuid);
|
||||
|
||||
result = result_str->str;
|
||||
g_string_free(result_str, FALSE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
char*
|
||||
p_sha1_hash(char *str)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user