don't send presence subscription requests for nameless numbers

This commit is contained in:
eta 2020-07-13 22:34:15 +01:00
parent ae303489ad
commit 37b3ae2014

View file

@ -548,11 +548,10 @@ Returns three values: avatar data (as two values), and a generalized boolean spe
(unless (sqlite:step-statement get-stmt) (unless (sqlite:step-statement get-stmt)
(error "No contact with localpart ~A exists!" localpart)) (error "No contact with localpart ~A exists!" localpart))
(with-bound-columns (subscription-state name notify ctid) get-stmt (with-bound-columns (subscription-state name notify ctid) get-stmt
(when (equal subscription-state "none")
(let ((name-to-use (or name (let ((name-to-use (or name
(when notify (concatenate 'string "~" notify)) (when notify (concatenate 'string "~" notify))))
(substitute #\+ #\u localpart)))
(from (concatenate 'string localpart "@" (component-name comp)))) (from (concatenate 'string localpart "@" (component-name comp))))
(when (and (equal subscription-state "none") name-to-use)
(with-presence (comp jid (with-presence (comp jid
:type "subscribe" :type "subscribe"
:from from) :from from)