Mercurial > prosody-modules
comparison mod_smacks/mod_smacks.lua @ 3986:9ec23a457f9a
mod_smacks: remove now unused code
author | tmolitor <thilo@eightysoft.de> |
---|---|
date | Tue, 21 Apr 2020 11:26:43 +0200 |
parents | c3e9caa29857 |
children | 362997ededb1 |
comparison
equal
deleted
inserted
replaced
3985:c3e9caa29857 | 3986:9ec23a457f9a |
---|---|
418 end | 418 end |
419 end | 419 end |
420 end | 420 end |
421 | 421 |
422 -- don't send delivery errors for messages which will be delivered by mam later on | 422 -- don't send delivery errors for messages which will be delivered by mam later on |
423 -- check if stanza was archived --> this will allow us to send back errors for stanzas not archived | |
424 -- because the user configured the server to do so ("no-archive"-setting for one special contact for example) | |
423 local function get_stanza_id(stanza, by_jid) | 425 local function get_stanza_id(stanza, by_jid) |
424 for tag in stanza:childtags("stanza-id", "urn:xmpp:sid:0") do | 426 for tag in stanza:childtags("stanza-id", "urn:xmpp:sid:0") do |
425 if tag.attr.by == by_jid then | 427 if tag.attr.by == by_jid then |
426 return tag.attr.id; | 428 return tag.attr.id; |
427 end | 429 end |
449 session.log("debug", "mod_smacks delivery/failuere returning %s for offline-handled stanza", tostring(ok)); | 451 session.log("debug", "mod_smacks delivery/failuere returning %s for offline-handled stanza", tostring(ok)); |
450 return ok; -- if stanza was handled, don't send an error | 452 return ok; -- if stanza was handled, don't send an error |
451 end | 453 end |
452 end | 454 end |
453 end | 455 end |
454 end); | |
455 | |
456 -- mark stanzas as archived --> this will allow us to send back errors for stanzas not archived | |
457 -- because the user configured the server to do so ("no-archive"-setting for one special contact for example) | |
458 module:hook("archive-message-added", function(event) | |
459 local session, stanza, for_user, stanza_id = event.origin, event.stanza, event.for_user, event.id; | |
460 local log = session.log or module._log | |
461 log("debug", "Marking stanza as archived, archive_id: %s, stanza: %s", tostring(stanza_id), tostring(stanza:top_tag())); | |
462 stanza._was_archived = true; | |
463 end); | 456 end); |
464 | 457 |
465 module:hook("pre-resource-unbind", function (event) | 458 module:hook("pre-resource-unbind", function (event) |
466 local session, err = event.session, event.error; | 459 local session, err = event.session, event.error; |
467 if session.smacks then | 460 if session.smacks then |