Commit Graph

21 Commits

Author SHA1 Message Date
diamondburned 0569261f72 Enforce Columnate in Server
This commit breaks the API to enforce all servers to have a Columnate
method.

This commit also changes some of the documentation to be more obvious.
2021-03-18 09:52:14 -07:00
diamondburned 1251001e8c Removed Icon interfaces, added ReadIndicator
This commit introduced a big breaking change of changing Author and
Namer to no longer have any reference to Icon or Image containers and
interfaces.

Instead, in the case of Author and Namer, it relies on the label being
updated by either an update setter or LabelContainer. The frontend
should get the first image/avatar to display that instead.

This commit also added ReadIndicator and related interfaces to support
the read receipts feature seen in Matrix, Telegram, Messenger and co.

The UnreadIndicator interface was broken to add the MarkRead method,
which hands explicit control of setting read messages for the current
user to the frontend instead.
2021-03-08 22:20:10 -08:00
diamondburned 41a7dac033 Added Columnator
This commit added the Columnator interface. This interface accommodates
the fact that some services (such as Discord) stylizes certain nested
servers in the same column.

This commit also fixed a minor test case.
2021-03-08 16:22:30 -08:00
diamondburned 06a26af5ba Slightly cleaner generation structure 2021-01-08 19:55:35 -08:00
diamondburned 7cb512f8b1 Added Replier and renamed Attachments
This commit renamed Attachments to Attacher, as the new name is more
idiomatic.

This commit also added the Replier interface, which is used to indicate
that a message being sent is a reply towards something.
2021-01-01 14:09:42 -08:00
diamondburned 24fc2c9bbb Fixed invalid types and bugs in MessageReferencer 2020-12-17 17:18:02 -08:00
diamondburned fd8106eaf1 Revert Nonce deprecation
This commit reverts commit 9fd965d45a.

The reason for this reversion is that Send does not return an ID, and
therefore cannot know if any of its incoming messages are what it sent
or not.

Although a message return can be added into Send, that would be
extraneous, as the same message may now arrive by Send returning and/or
through the messenger container. Working around this would require
having an Upsert behavior instead of Insert or Update.
2020-12-17 12:44:52 -08:00
diamondburned 9fd965d45a Deprecated Nonce
This commit deprecates all Nonce methods as well as the concept of
Nonces in general. This is because in certain cases where coordination
between message sends and echoes would require far too much effort with
nonces as a method to detect message arrivals.

Starting from this commit, frontend implementations must assume that a
nil error returned from Sender's Send method means that the message has
successfully arrived.

Backend implementations must provide this guarantee if necessary by
blocking Send until it's sure that the message has arrived. For services
that send messages asynchronously, a handler and a blocking channel
(or pubsub) could be used to signal to the Send goroutine from the event
loop that the message has arrived. Backends may choose to transmit its
own nonces for this purpose.
2020-12-16 23:44:50 -08:00
diamondburned 4c835a467b Fixed several ArgsIndexed bugs
This commit fixes several ArgsIndexed bugs that would cause the function
to return no words with -1. Additional test cases have been added.
2020-10-14 23:24:26 -07:00
diamondburned 10549e49e1 Added SplitFunc helper type
This commit adds the SplitFunc helper type which has a function
signature matching that of ArgsIndexer and SplitIndexer. Implementations
can use this type to provide pluggable splitters.
2020-10-14 18:26:49 -07:00
diamondburned 289eda1c25 Clarified Commander split rules; added ArgsIndexed
This commit clarified the word split rules when it comes to the
Commander interface. Specifically, this interface now has an edge case
of having split rules similarly to shell words (or shell syntax).

The implementation of these split rules is added into package split,
similarly to SplitIndexed. It is called ArgsIndexed. For the most parts,
it will behave similarly to shell syntax.
2020-10-14 18:08:35 -07:00
diamondburned 1b1e10a8a6 Updated reference split package to int64
This commit breaks package split's API to take in int64 types instead of
int. This is because CompletionEntry now uses int64 over int for
concreteness.
2020-10-09 09:34:02 -07:00
diamondburned 89b5ede1d8 Regenerated code to adhere to codegen header
This commit regenerates all files to adhere to the arguably-official
convention of having a standardized comment format to allow
distinguishing between written and generated files.

Refer to https://golang.org/s/generatedcode for more information.
2020-10-04 14:33:57 -07:00
diamondburned e08064021e Reproducible empty interface code generation
Prior to this commit, the code generator for package empty doesn't have
a defined order. This commit now sorts the packages before generation,
which gets rid of the main map's undefined order.
2020-10-03 23:24:15 -07:00
diamondburned dd4e230e0f Fixed UnreadContainer's comment
Prior to this commit, UnreadContainer's comments mentioned deprecated
SetUnread and such methods. It now reflects the new API.
2020-10-03 23:17:32 -07:00
diamondburned 99f7224d32 Mentioned now returns bool
Prior to this commit, the Mentioned method in MessageCreate didn't
return anything. This is a regression. It now returns a boolean that
indicates mentioned.
2020-10-03 23:14:54 -07:00
diamondburned 7b9b4864a5 Fixed package empty having wrong package name 2020-10-03 20:00:09 -07:00
diamondburned 2d00544d67 Added missing methods from embedded interfaces
This commit adds missing empty asserter methods from the interfaces
embedded in the parent interface.
2020-10-03 19:56:58 -07:00
diamondburned 59778af1dd Empty impls for package text
This commit adds empty structs that implement no-op asserter methods for
interfaces in package text. Those implementations have "Text" prefixed
to their names.

The added implementations stay in the same place as cchat's.
2020-10-03 19:31:44 -07:00
diamondburned 25980eb794 Added package empty
This package adds the code generation for package empty, which provides
structs that has no-op asserter methods for ease of use.

The package demonstrates one of the many possible use cases of having a
repository ready for code generation.
2020-10-03 14:31:38 -07:00
diamondburned (Forefront) 8fdf82883a Moved package split to utils 2020-06-10 12:19:13 -07:00