aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-20 22:31:27 +0100
committerKim Alvefur <zash@zash.se>2019-12-20 22:31:27 +0100
commit6d3006307dd0bd38861102dcd2d51cb75e100224 (patch)
tree86a2b72b2f159dd7a869b94998292d7223b01f72 /core
parentb3259cf52e03c1b81c823de04a3471ba60f080c6 (diff)
downloadprosody-6d3006307dd0bd38861102dcd2d51cb75e100224.tar.gz
prosody-6d3006307dd0bd38861102dcd2d51cb75e100224.zip
core.stanza_router: Extract host part of JIDs directly [luacheck]
Silences warning about unused return values
Diffstat (limited to 'core')
-rw-r--r--core/stanza_router.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index a74f3b6f..dab83803 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -12,6 +12,7 @@ local hosts = _G.prosody.hosts;
local tostring = tostring;
local st = require "util.stanza";
local jid_split = require "util.jid".split;
+local jid_host = require "util.jid".host;
local jid_prepped_split = require "util.jid".prepped_split;
local full_sessions = _G.prosody.full_sessions;
@@ -81,7 +82,7 @@ function core_process_stanza(origin, stanza)
local to_bare, from_bare;
if to then
if full_sessions[to] or bare_sessions[to] or hosts[to] then
- node, host = jid_split(to); -- TODO only the host is needed, optimize
+ host = jid_host(to);
else
node, host, resource = jid_prepped_split(to);
if not host then
@@ -186,8 +187,8 @@ function core_post_stanza(origin, stanza, preevents)
end
function core_route_stanza(origin, stanza)
- local node, host, resource = jid_split(stanza.attr.to);
- local from_node, from_host, from_resource = jid_split(stanza.attr.from);
+ local host = jid_host(stanza.attr.to);
+ local from_host = jid_host(stanza.attr.from);
-- Auto-detect origin if not specified
origin = origin or hosts[from_host];