Don't send "phone number"-named roster entries in roster exchanges
This commit is contained in:
parent
807acd42b3
commit
acfa5c236d
4
db.lisp
4
db.lisp
|
@ -65,14 +65,14 @@
|
||||||
while (sqlite:step-statement get-stmt)
|
while (sqlite:step-statement get-stmt)
|
||||||
append (column-values get-stmt))))
|
append (column-values get-stmt))))
|
||||||
|
|
||||||
(defun get-contact-name (uid localpart)
|
(defun get-contact-name (uid localpart &key no-phone-number)
|
||||||
"Get a name for LOCALPART, a possible contact for the user with ID UID."
|
"Get a name for LOCALPART, a possible contact for the user with ID UID."
|
||||||
(with-prepared-statements
|
(with-prepared-statements
|
||||||
((get-stmt "SELECT name, notify FROM user_contacts WHERE user_id = ? AND wa_jid = ?"))
|
((get-stmt "SELECT name, notify FROM user_contacts WHERE user_id = ? AND wa_jid = ?"))
|
||||||
(bind-parameters get-stmt uid localpart)
|
(bind-parameters get-stmt uid localpart)
|
||||||
(when (sqlite:step-statement get-stmt)
|
(when (sqlite:step-statement get-stmt)
|
||||||
(with-bound-columns (name notify) get-stmt
|
(with-bound-columns (name notify) get-stmt
|
||||||
(or name notify (substitute #\+ #\u localpart))))))
|
(or name notify (unless no-phone-number (substitute #\+ #\u localpart)))))))
|
||||||
|
|
||||||
(defun get-contact-status (uid localpart)
|
(defun get-contact-status (uid localpart)
|
||||||
"Get the contact status text for LOCALPART, a possible contact for the user with ID UID."
|
"Get the contact status text for LOCALPART, a possible contact for the user with ID UID."
|
||||||
|
|
16
stuff.lisp
16
stuff.lisp
|
@ -908,13 +908,15 @@ Returns three values: avatar data (as two values), and a generalized boolean spe
|
||||||
ct-localpart
|
ct-localpart
|
||||||
"@"
|
"@"
|
||||||
(component-name comp)))
|
(component-name comp)))
|
||||||
(ct-name (get-contact-name uid ct-localpart)))
|
(ct-name (get-contact-name uid ct-localpart
|
||||||
(cxml:with-element "item"
|
:no-phone-number t)))
|
||||||
(cxml:attribute "action" "add")
|
(when ct-name
|
||||||
(cxml:attribute "jid" ct-jid)
|
(cxml:with-element "item"
|
||||||
(cxml:attribute "name" ct-name)
|
(cxml:attribute "action" "add")
|
||||||
(cxml:with-element "group"
|
(cxml:attribute "jid" ct-jid)
|
||||||
(cxml:text "WhatsApp"))))))))))
|
(cxml:attribute "name" ct-name)
|
||||||
|
(cxml:with-element "group"
|
||||||
|
(cxml:text "WhatsApp")))))))))))
|
||||||
|
|
||||||
(defun handle-admin-command (comp from body uid)
|
(defun handle-admin-command (comp from body uid)
|
||||||
"Handles an admin command sent to COMP."
|
"Handles an admin command sent to COMP."
|
||||||
|
|
Loading…
Reference in a new issue