This commit adds member list support for servers capable of showing
messages. This includes both backend and frontend interfaces.
A UserStatus type was added with the appropriate constants for this purpose,
but it could be used in the future for other purposes.
All cchat documentation has been moved off of the README and into
GoDoc's documentation sections. This is done to free up the README for
other useful information about the project that doesn't have to do with
the code itself.
This commit adds the MentionerAvatar and MentionedImage interfaces. This
interface gives the mentioned object an avatar or image. An example of
this would be showing a user's avatar. This allows the frontend to do
simple layouting.
The new behavior for Mentioner states that the frontends should be able
to use the highlighted segment as the mentioned object's display name.
For example, if the mentioned segment highlights "@username", then the
frontend should display "@username" as the large text.
This change was done because using a message as an argument for
SetMentioned was too much. The client can manually check which messages
have Mentioned being true and highlight them.
As we no longer need a message forr SetMentioned, it is now merged into
SetUnread. As such, SetUnread now takes both an unread and a mentioned
boolean.
This commit is a breaking change. It changes the UnreadIndicate method
to require returning an additional stop callback similar to that in
Nickname.
The motivation for this change was that frontends need a way to announce
cancellation before it destroys its server containers. This may happen
when the backend wants to replace in the container a completely new
list. As such, old lists will be destroyed, and the frontend will call
UnreadIndicate again. Because of that, the old callbacks must be cleaned
up.
This commit adds message attachments. More specifically, the
MessageAttachment struct was added to represent a single attachment.
Interfaces are added as well, that is ServerMessageAttachmentSender and
SendableMessageAttachments.
For the most parts, the frontend will use SendableMessageAttachments,
which extends the usual SendableMessage.
This commit adds the Mentioner interface. The objective is to have a
clickable mention string similar to that in Discord, that when pressed
will popup a small box containing the given user info.
In the future, Mentioner may be expanded to add Avatar capabilities, but
for now, it can be added using text segments.
This commit also clarified that segments can implement multiple
interfaces. This is done to allow segments such as Mentioner to also be
colored using Colorer.
Frontend implementations should, instead of a type switch, use multiple
if statements separately. This may introduce a lot more boilerplate code.
This commit adds Avatarer into the list of supported text segments. This
should work very similarly to Imager, except that avatars should be
rounded by the frontend.
This commit should make the text image APIs consistent with the main
cchat package.
This commit undos these latest changes and replaced them with the new
ImageContainer API as well as Image boolean in CompletionEntry.
These changes, unlike the earlier commits, are not breaking changes.
They are only additions.
ImageContainer is added for future usages, which translates to the
previous commits' IconContainer. The current IconContainer translates to
the previous commits' RoundIconContainer.
This change was done without breaking the existing API. Initially, the
idea was to use a URL fragment to indicate if an icon should be round.
That, however, was a bad idea, as URL fragments are part of the URL
string and would require additional effort to parse them. As such,
RoundIconContainer was added.
Frontends don't need to round icons from RoundIconContainer, and as
such, may call IconContainer in the implementation. The choice of using
round icons is up to the backend implementations.
This breaking change was done to provide a clean API for backends to
remove event handlers when they're not needed anymore. It also moves the
cancellation logic from the backend to the frontend, making it easier
for backends.
This commit adds typing capabilities and indicator interfaces into
cchat. The objective is to provide an API for typing event APIs similar
to Discord's and IRCv3's.
This is a breaking change, as it modifies the ServerMessageEditor
interface.
This breaking change is done with the assumption that not all services
will support editing every single message. For example, Discord only
allows editing your own messages.
With the introduction of a MessageEditable method, services shouldn't
have to return an error to indicate that a message isn't editable
anymore.
This change was done to add support to messages that may have more or
less actions. For example, this lets the backend only display the
"Delete" option when the message can be deleted.
Documentation is also corrected and further done in this commit.
This is done instead of text substitution, as images might have contexts
and other important attributes. One such example is an emoji, which may
have worked with text substitution, but would also work with a simple
string append.
This commit specifies that images cannot substitute a piece of text with
itself. This means that end bounds of those segments are ignored, and
images will be inserted where the start bounds point them to.
Frontends that can't actually display images should represent this
information in another way by itself. One way is to treat this as a
hyperlink that says "Image."
This was done because handling text substitution would make rich text
renderers much more complex. Instead of lazily preprocessing all
segments into a list of attributes and lazily inserting them into a
new text, they would now have to account for text substitutions,
which would be overkill for a single link.
As a tradeoff, frontends that don't render rich texts and only use the
Content string will not see any URLs. Instead, it will only see the
underlying text of the URL, except without the actual hyperlink.