Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify chat protocol #74

Merged
merged 3 commits into from Jul 11, 2021
Merged

simplify chat protocol #74

merged 3 commits into from Jul 11, 2021

Conversation

epoberezkin
Copy link
Member

No description provided.

@epoberezkin epoberezkin changed the title groups protocol and some group commands chat groups Jul 8, 2021
@epoberezkin epoberezkin changed the title chat groups simplify chat profit Jul 10, 2021
@epoberezkin epoberezkin changed the title simplify chat profit simplify chat protocol Jul 10, 2021
Comment on lines +326 to +330
<|> ("/group #" <|> "/g #") *> (NewGroup <$> groupRef)
<|> ("/add #" <|> "/a #") *> (AddMember <$> groupRef <* A.space <*> contactRef <* A.space <*> memberRole)
<|> ("/remove #" <|> "/rm #") *> (RemoveMember <$> groupRef <* A.space <*> contactRef)
<|> ("/delete #" <|> "/d #") *> (DeleteGroup <$> groupRef)
<|> ("/members #" <|> "/ms #") *> (ListMembers <$> groupRef)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a critique, just a thought - maybe we could have a subcommand for group commands (e.g. instead of "#" - /group new, /group add, /group remove, etc.), so that it's harder to mix up groups and regular contacts namespaces? also maybe move group ChatCommands under GroupCommand which is also a ChatCommand but has different constructors of its own to somewhat separate group commands on types level as well? I'm not sure of benefits other than clearer distinction between group and contact commands on types and parsers, but I just felt it starts to feel somewhat crowded in ChatCommands and probably will only become more so. For example if we later introduce something like "Service" or "Configuration commands" letting client to control app - they'd also be mixed into the same ChatCommands namespace. Instead we could have separate namespaces for them, groups, actually regular contacts as well, and maybe others

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will think about it... not needed at the moment

@epoberezkin epoberezkin merged commit 24c6258 into v4 Jul 11, 2021
@epoberezkin epoberezkin deleted the chat-groups branch July 11, 2021 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants