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)
|
||||
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."
|
||||
(with-prepared-statements
|
||||
((get-stmt "SELECT name, notify FROM user_contacts WHERE user_id = ? AND wa_jid = ?"))
|
||||
(bind-parameters get-stmt uid localpart)
|
||||
(when (sqlite:step-statement 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)
|
||||
"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
|
||||
"@"
|
||||
(component-name comp)))
|
||||
(ct-name (get-contact-name uid ct-localpart)))
|
||||
(cxml:with-element "item"
|
||||
(cxml:attribute "action" "add")
|
||||
(cxml:attribute "jid" ct-jid)
|
||||
(cxml:attribute "name" ct-name)
|
||||
(cxml:with-element "group"
|
||||
(cxml:text "WhatsApp"))))))))))
|
||||
(ct-name (get-contact-name uid ct-localpart
|
||||
:no-phone-number t)))
|
||||
(when ct-name
|
||||
(cxml:with-element "item"
|
||||
(cxml:attribute "action" "add")
|
||||
(cxml:attribute "jid" ct-jid)
|
||||
(cxml:attribute "name" ct-name)
|
||||
(cxml:with-element "group"
|
||||
(cxml:text "WhatsApp")))))))))))
|
||||
|
||||
(defun handle-admin-command (comp from body uid)
|
||||
"Handles an admin command sent to COMP."
|
||||
|
|
Loading…
Reference in a new issue