better view

This commit is contained in:
spaced4ndy
2025-10-31 17:24:16 +04:00
parent a736b9de04
commit 2a6cc8fd62

View File

@@ -1147,8 +1147,9 @@ viewReceivedContactRequest c Profile {fullName, shortDescr} =
"to reject: " <> highlight ("/rc " <> viewName c) <> " (the sender will NOT be notified)"
]
-- TODO [relays] operator: CLI specific apis based on name
viewGroupCreated :: GroupInfo -> Bool -> [StyledString]
viewGroupCreated g testView =
viewGroupCreated g@GroupInfo {groupId} testView =
case incognitoMembershipProfile g of
Just localProfile
| testView -> incognitoProfile' profile : message
@@ -1157,12 +1158,22 @@ viewGroupCreated g testView =
profile = fromLocalProfile localProfile
message =
[ "group " <> ttyFullGroup g <> " is created, your incognito profile for this group is " <> incognitoProfile' profile,
"to add members use " <> highlight ("/create link #" <> viewGroupName g)
instruction
]
instruction
| useRelays' g = relaysInstruction
| otherwise = "to add members use " <> highlight ("/create link #" <> viewGroupName g)
Nothing ->
[ "group " <> ttyFullGroup g <> " is created",
"to add members use " <> highlight ("/a " <> viewGroupName g <> " <name>") <> " or " <> highlight ("/create link #" <> viewGroupName g)
instruction
]
where
instruction
| useRelays' g = relaysInstruction
| otherwise = "to add members use " <> highlight ("/a " <> viewGroupName g <> " <name>") <> " or " <> highlight ("/create link #" <> viewGroupName g)
where
relaysInstruction =
"to add members use " <> highlight ("/_create relayed link #" <> show groupId <> " auto_choose_relays=on/off")
viewCannotResendInvitation :: GroupInfo -> ContactName -> [StyledString]
viewCannotResendInvitation g c =