From 6d807003296828d0dfdc685d5ff797f5301bbe6f Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 30 Aug 2018 11:01:28 +0200 Subject: 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 --- src/xmpp/presence.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/xmpp/presence.c') diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index 8efb60e0..8fcc44a8 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -128,7 +128,7 @@ presence_subscription(const char *const jid, const jabber_subscr_t action) xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *presence = xmpp_presence_new(ctx); - char *id = create_unique_id("sub"); + char *id = connection_create_stanza_id("sub"); xmpp_stanza_set_id(presence, id); free(id); @@ -211,7 +211,7 @@ presence_send(const resource_presence_t presence_type, const int idle, char *sig xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *presence = xmpp_presence_new(ctx); - char *id = create_unique_id("presence"); + char *id = connection_create_stanza_id("presence"); xmpp_stanza_set_id(presence, id); free(id); @@ -579,7 +579,7 @@ _handle_caps(const char *const jid, XMPPCaps *caps) caps_map_jid_to_ver(jid, caps->ver); } else { log_info("Capabilities cache miss: %s, for %s, sending service discovery request", caps->ver, jid); - char *id = create_unique_id("caps"); + char *id = connection_create_stanza_id("caps"); iq_send_caps_request(jid, id, caps->node, caps->ver); free(id); } @@ -588,14 +588,14 @@ _handle_caps(const char *const jid, XMPPCaps *caps) // unsupported hash, xep-0115, associate with JID, no cache } else if (caps->hash) { log_info("Hash %s not supported: %s, sending service discovery request", caps->hash, jid); - char *id = create_unique_id("caps"); + char *id = connection_create_stanza_id("caps"); iq_send_caps_request_for_jid(jid, id, caps->node, caps->ver); free(id); // no hash, legacy caps, cache against node#ver } else if (caps->node && caps->ver) { log_info("No hash specified: %s, legacy request made for %s#%s", jid, caps->node, caps->ver); - char *id = create_unique_id("caps"); + char *id = connection_create_stanza_id("caps"); iq_send_caps_request_legacy(jid, id, caps->node, caps->ver); free(id); } else { -- cgit 1.4.1-2-gfad0 'hashes'>
6dabbbd5 ^


6dabbbd5 ^

30b5f112 ^










6dabbbd5 ^
fcf4d143 ^
6dabbbd5 ^



30b5f112 ^

6dabbbd5 ^
30b5f112 ^








6dabbbd5 ^





30b5f112 ^
71679a31 ^

6dabbbd5 ^


6dabbbd5 ^
30b5f112 ^
2f82f50a ^
86c1c388 ^
1a3dc91e ^
30b5f112 ^
6dabbbd5 ^
30b5f112 ^
fbc30231 ^

















cd2458c0 ^

0ae975c2 ^

b21edfaa ^
cd2458c0 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78