Software /
code /
verse
Comparison
plugins/legacy.lua @ 457:73d4eb93657b
Update to use util.id for random ids instead of counters (thanks Zash)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 16 Mar 2023 11:41:52 +0000 |
parent | 381:65533afab352 |
child | 490:6b2f31da9610 |
comparison
equal
deleted
inserted
replaced
456:6a65142052c8 | 457:73d4eb93657b |
---|---|
1 local verse = require "verse"; | 1 local verse = require "verse"; |
2 local uuid = require "util.uuid".generate; | 2 local new_id = require "util.id".short; |
3 | 3 |
4 local xmlns_auth = "jabber:iq:auth"; | 4 local xmlns_auth = "jabber:iq:auth"; |
5 | 5 |
6 function verse.plugins.legacy(stream) | 6 function verse.plugins.legacy(stream) |
7 local function handle_auth_form(result) | 7 local function handle_auth_form(result) |
13 -- COMPAT continue anyways | 13 -- COMPAT continue anyways |
14 end | 14 end |
15 local auth_data = { | 15 local auth_data = { |
16 username = stream.username; | 16 username = stream.username; |
17 password = stream.password; | 17 password = stream.password; |
18 resource = stream.resource or uuid(); | 18 resource = stream.resource or new_id(); |
19 digest = false, sequence = false, token = false; | 19 digest = false, sequence = false, token = false; |
20 }; | 20 }; |
21 local request = verse.iq({ to = stream.host, type = "set" }) | 21 local request = verse.iq({ to = stream.host, type = "set" }) |
22 :tag("query", { xmlns = xmlns_auth }); | 22 :tag("query", { xmlns = xmlns_auth }); |
23 if #query > 0 then | 23 if #query > 0 then |