From 807acd42b382631b8675e6b402735cec5ed3a5e8 Mon Sep 17 00:00:00 2001 From: eta Date: Fri, 21 Aug 2020 19:34:00 +0100 Subject: [PATCH] When replying to presence probes, only reply to the requesting resource --- stuff.lisp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stuff.lisp b/stuff.lisp index 289c11a..08f424d 100644 --- a/stuff.lisp +++ b/stuff.lisp @@ -435,7 +435,7 @@ Returns three values: avatar data (as two values), and a generalized boolean spe (lambda (conn result) (wa-handle-avatar-result comp conn jid localpart result)))) -(defun handle-wa-contact-presence (comp conn jid localpart &key noretry) +(defun handle-wa-contact-presence (comp conn jid localpart &key noretry destination) "Send out a presence stanza for LOCALPART to JID, or queue requests for that user's status or avatar if they're lacking." (unless (uiop:string-prefix-p "u" localpart) (return-from handle-wa-contact-presence)) @@ -446,7 +446,7 @@ Returns three values: avatar data (as two values), and a generalized boolean spe (get-contact-avatar-data uid localpart) (declare (ignore avatar-data)) (if (and has-avatar-p status) - (with-presence (comp jid + (with-presence (comp (or destination jid) :from (concatenate 'string localpart "@" @@ -1148,7 +1148,8 @@ Returns three values: avatar data (as two values), and a generalized boolean spe (admin-presence comp from admin-status admin-show))) ((or (not uid) (not conn)) (respond-with-unavailable)) ((get-contact-name uid to-localpart) - (handle-wa-contact-presence comp conn stripped to-localpart)) + (handle-wa-contact-presence comp conn stripped to-localpart + :destination from)) (t (respond-with-unavailable)))))))) (defun whatsxmpp-presence-subscribe-handler (comp &key from to id &allow-other-keys)