mirror of
https://github.com/unclebob/more-speech.git
synced 2024-09-30 02:21:02 +00:00
Search is working. More could be added I suppose. Added treating petnames and usernames as ids.
This commit is contained in:
parent
280ed9b187
commit
2286aab967
@ -85,5 +85,13 @@
|
||||
{:id 153N :pubkey 2N :content ""
|
||||
:tags [[:e (util/hexify 1N)]
|
||||
[:p (util/hexify 88N)]]})))
|
||||
|
||||
(it "should match if username matches any p tag"
|
||||
(set-mem :pubkey 99N)
|
||||
(gateway/add-profile @db 1N {:name "username"})
|
||||
(should (match-target "username"
|
||||
{:id 153N :pubkey 2N :content ""
|
||||
:tags [[:e (util/hexify 1N)]
|
||||
[:p (util/hexify 88N)]]})))
|
||||
)
|
||||
)
|
||||
|
@ -30,6 +30,7 @@
|
||||
(let [content (formatters/replace-references event)
|
||||
author-name (:name (gateway/get-profile (get-db) (:pubkey event)))
|
||||
author-id (contact-list/get-pubkey-from-petname target)
|
||||
author-id (or author-id (gateway/get-id-from-username (get-db) target))
|
||||
petname (contact-list/get-petname (:pubkey event))
|
||||
subject (get-subject event)
|
||||
re-target (re-pattern target)]
|
||||
|
Loading…
Reference in New Issue
Block a user