summaryrefslogtreecommitdiff
path: root/src/Contact.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Contact.hs')
-rw-r--r--src/Contact.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Contact.hs b/src/Contact.hs
index 4e2cb17..6585985 100644
--- a/src/Contact.hs
+++ b/src/Contact.hs
@@ -4,6 +4,8 @@ module Contact (
contactCustomName,
contactName,
+ contactSetName,
+
ContactService,
contactRequest,
contactAccept,
@@ -79,6 +81,16 @@ contactName c = fromJust $ msum
, Just T.empty
]
+contactSetName :: MonadHead LocalState m => Contact -> Text -> Set Contact -> m (Set Contact)
+contactSetName contact name set = do
+ st <- getStorage
+ cdata <- wrappedStore st ContactData
+ { cdPrev = toComponents contact
+ , cdIdentity = []
+ , cdName = Just name
+ }
+ storeSetAdd st (mergeSorted @Contact [cdata]) set
+
type ContactService = PairingService ContactAccepted