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
1 changed files with 4 additions and 5 deletions

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)) (from (concatenate 'string localpart "@" (component-name comp))))
(substitute #\+ #\u localpart))) (when (and (equal subscription-state "none") name-to-use)
(from (concatenate 'string localpart "@" (component-name comp))))
(with-presence (comp jid (with-presence (comp jid
:type "subscribe" :type "subscribe"
:from from) :from from)