Commit Graph

76 Commits

Author SHA1 Message Date
diamondburned 7ae629e1ca Added the ISC license 2020-07-19 10:44:34 -07:00
diamondburned c45d874a80 Added member list support; moved documentation off README and into GoDoc
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.
2020-07-19 10:37:51 -07:00
diamondburned 8827df937d Added MentionerAvatar and MentionedImage; clarified new behavior for Mentioner
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.
2020-07-19 00:55:57 -07:00
diamondburned 9a7fe13cef Removed SetMentioned from UnreadIndicator
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.
2020-07-16 18:53:54 -07:00
diamondburned 9974fcc636 Changes ServerMessageUnreadIndicator to return a cancel callback
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.
2020-07-16 18:40:18 -07:00
diamondburned 1fe254db60 Added documentation to clarify attachments 2020-07-09 16:13:17 -07:00
diamondburned 106b543f09 Adds message attachments
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.
2020-07-09 16:03:35 -07:00
diamondburned ecbd4515a2 Added Mentioner and clarifications
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.
2020-07-07 13:26:39 -07:00
diamondburned (Forefront) 0abbf861bc Added Avatarer into package text
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.
2020-07-04 01:15:50 -07:00
diamondburned (Forefront) c8d6c89a08 Added Time into Typer 2020-07-01 13:32:54 -07:00
diamondburned (Forefront) 78767a3f2f Undo latest changes that added RoundIconContainers
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.
2020-07-01 10:49:44 -07:00
diamondburned (Forefront) d29ee70d56 Updated README to add RoundIconContainer 2020-06-30 19:46:50 -07:00
diamondburned (Forefront) e7aa6fb885 Added secondary text into completion entry; added 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.
2020-06-30 19:43:42 -07:00
diamondburned (Forefront) d754f011ba Clarified RunCommand's documentation
This clarification applies on the latest release; however, no releases
will be made for it.
2020-06-29 19:57:11 -07:00
diamondburned (Forefront) a8cfc54f6d Breaking: Added stop callbacks to functions that take in containers
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.
2020-06-29 13:27:00 -07:00
diamondburned (Forefront) 88879d45f2 Added typing capabilities and indicator interfaces
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.
2020-06-29 11:39:59 -07:00
diamondburned (Forefront) 88834ab465 Added MessageEditable into ServerMessageEditor
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.
2020-06-27 23:31:34 -07:00
diamondburned (Forefront) 5d2cd4a57b MessageActions now takes in a message ID.
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.
2020-06-20 15:52:04 -07:00
diamondburned (Forefront) 6c7cd5feb2 Added UnreadIndicator and ServerMessageIndicator for unread indicators 2020-06-20 15:02:05 -07:00
diamondburned (Forefront) dfb60ac0eb text.Rich to implement Stringer; extra docs 2020-06-20 00:10:23 -07:00
diamondburned (Forefront) e953dbbcb1 Added extra methods onto Imager.
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.
2020-06-17 20:45:30 -07:00
diamondburned (Forefront) 05b7a6a10c Specified that Images cannot do text substitution
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."
2020-06-17 17:34:38 -07:00
diamondburned (Forefront) ba88528a7a Removed text substitution from hyperlinks
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.
2020-06-17 17:02:56 -07:00
diamondburned (Forefront) d4917d2e6d Added Has to text.Attribute 2020-06-17 16:10:53 -07:00
diamondburned (Forefront) 6bb1d742a2 Clarified IO rules for ServerMessageEditor 2020-06-17 13:39:52 -07:00
diamondburned (Forefront) 7698aa5fc2 Removed some arguments such as context to reduce complexity 2020-06-14 18:46:59 -07:00
diamondburned (Forefront) 8768baf196 Added usage of context.Context into the API for cancellation 2020-06-14 16:00:18 -07:00
diamondburned (Forefront) 391004677b Added error handling behavior documentation for Disconnect 2020-06-13 16:33:33 -07:00
diamondburned (Forefront) 831a6ea7e6 Added Disconnect into the server requirement 2020-06-13 16:29:30 -07:00
diamondburned (Forefront) 4a7f7a7994 Added Raw into CompletionEntry 2020-06-10 17:38:59 -07:00
diamondburned (Forefront) b38dc6c6b4 Added extra docs 2020-06-10 16:10:03 -07:00
diamondburned (Forefront) 8fdf82883a Moved package split to utils 2020-06-10 12:19:13 -07:00
diamondburned (Forefront) 66dd2b1b11 Added split package to help with completions 2020-06-10 01:12:41 -07:00
diamondburned (Forefront) b6eca8eafa Improved documentation for CompleteEntry 2020-06-09 21:05:59 -07:00
diamondburned (Forefront) 2e7c6b0098 Added blocks into richtext and AttrDim into inline attributes 2020-06-09 20:51:54 -07:00
diamondburned (Forefront) 557ac54a04 Extended CompleteMessage 2020-06-09 20:38:44 -07:00
diamondburned (Forefront) 2eed8da97f Minor documentation fix 2020-06-09 20:25:10 -07:00
diamondburned (Forefront) 242f2c6192 Added clarifications on containers (applies to all versions) 2020-06-08 20:52:24 -07:00
diamondburned (Forefront) 72966ad02a Allow Names to be in rich text 2020-06-08 20:37:40 -07:00
diamondburned (Forefront) ce009a8cba Name is now required for some interfaces, improved README 2020-06-08 20:35:04 -07:00
diamondburned (Forefront) b4abf67cca Revert cancel callback on most containers 2020-06-08 15:49:53 -07:00
diamondburned (Forefront) a2235171a1 DoAction should not need to return a stop callback. 2020-06-08 14:46:36 -07:00
diamondburned (Forefront) 01e6e1ce31 Deprecated LeaveServer API in favor of cancel callbacks 2020-06-08 14:20:21 -07:00
diamondburned (Forefront) 7194d04894 Added MessagesContainer into DoMessageAction 2020-06-08 00:00:39 -07:00
diamondburned (Forefront) 231088e94d Added ServerMessage{Editor,Actioner} 2020-06-07 23:42:01 -07:00
diamondburned (Forefront) fa7f2fdca4 Fixed color hexadecimal invalid size 2020-06-03 21:15:52 -07:00
diamondburned (Forefront) deadc66d46 Added label and icon containers to allow updates, minor changes 2020-06-03 19:40:36 -07:00
diamondburned (Forefront) 3eb64db96c Fixed MessageCreate not having updated Author return type 2020-06-03 11:42:12 -07:00
diamondburned (Forefront) 46debdf53b Clarify that Commander extends Sessions 2020-06-03 00:05:14 -07:00
diamondburned (Forefront) 9b3e03753c Added full interface implementations for reference 2020-06-02 23:56:34 -07:00