Commit Graph

55 Enmetoj

Author SHA1 Message Date
Jaidyn Ann 10b63e4138 x86 fix for ItemWeight use 2021-08-22 11:44:03 -05:00
Jaidyn Ann 8f159b7e8b Rename Cardie to Chat-O-Matic 2021-08-19 02:29:14 -05:00
Jaidyn Ann 2645a58955 ScrollView for roomlist, NO_BORDER for user scroll 2021-08-18 11:58:18 -05:00
Jaidyn Ann b8de54d9bc Single Append() for sections with unchanged format
Also removes the newly-unused AppendMessage() of RenderView
2021-08-17 22:19:28 -05:00
Jaidyn Ann 8512e9ad03 New binary log format, with color/face support
Binary logs are no longer stored as a single message with a list of
strings and int64s ("body", "user_name", "user_id", "when"), but a
message with sub-messages (IM_MESSAGE_RECEIVED) verbatim saved.

This has the main benefit of preserving message formatting (coloring,
bold, italics, etc).
2021-08-17 13:27:14 -05:00
Jaidyn Ann ab4881f2f0 Receiving multi-color messages
Chat messages can now be formatted with colors in addition to varying
faces with "color_start," "color_length," and "color" slots in
IM_MESSAGE_RECEIVED.
2021-08-16 21:50:43 -05:00
Jaidyn Ann 8aa608e841 Formatted welcome message, prefer 'user_name' 2021-08-16 15:10:18 -05:00
Jaidyn Ann 29a94bcf65 Recieving of formatted messages (by font-face)
Now addons can format messages with new slots accepted by
IM_MESSAGE_RECEIVED: "face_start," "face_length," and "face".

The first two deal with the position of the face-change by character
offset in the string, and the last being the face flag affected.
2021-08-13 12:39:47 -05:00
Jaidyn Ann 057e7fba9b Add "system buffer" per protocol
Now, per each account, there is a read-only chat view associated with
it, accessible through its item in the conversations list. This can be
used to place system messages, MOTDs, insignificant errors, etc.

Protocols can send text to this buffer by specifying no "chat_id" in
an IM_MESSAGE_RECEIVED message.
2021-08-12 15:43:52 -05:00
Jaidyn Ann 409eaede86 Store users' names in binary chat logs 2021-08-11 20:22:42 -05:00
Jaidyn Ann fed3b9d9f0 Display message in chat on subject change 2021-08-11 19:46:33 -05:00
Jaidyn Ann 4bd821eee5 Account-toggling through Accounts menu 2021-08-07 17:37:16 -05:00
Jaidyn Ann 3861fa718d Remove unused APP_*_CHAT_WINDOW messages 2021-08-05 21:05:59 -05:00
Jaidyn Ann f0ce3e87c6 Support generally setting own nick, own UserItems
Seperate UserItems are now created for each list, too, rather than a
single one being created per-user. This functionally works a lot nicer.

But onto more important things… now setting the user's own nick should
work quite well. Finally. =w=

This has given me a good bit of trouble over the past couple of days―
setting the user's nick *worked*, but it wouldn't propagate to its
corresponding UserItem nor its UserInfoDialog. It would, however, work
with the StatusView.

These are all registered Observers of the User itself, so if one works,
they *all* should, them all being registered to the same User.

Now, if a given User isn't found in the ProtocolLooper's user-list,
the Conversation class will take it upon itself to create a new
one and add it to both of their respective lists.

So the user's own contact would be set in the ProtocolLooper― but it
*wouldn't* be added to the user-list.

Hilarity ensues as two seperate objects for the user's own contact would
be created.

Since the StatusView is registered to the ProtocolLooper's "real" own contact
slot, it would receive all updates… but since Conversations' user-lists and
items would be registered to the Conversation-created "fake" user, they
would be borked.

Simple oversight, but wow it hecked with me. :P
2021-08-05 14:28:56 -05:00
Jaidyn Ann db70ce4f57 Tweak Master Foo dialog 2021-08-03 16:33:18 -05:00
Jaidyn Ann 803a2f20bd /me now formats /me properly
/me waves arms in the air like a maniac
/me knocks over a nearby cup of coffee
/me gasps when the coffee spills onto the adjacent laptop
/me cries out “Fore! Wait, four! Wait, fire!” when the laptop bursts
into flames
/me burns to a crisp
2021-07-31 20:39:21 -05:00
Jaidyn Ann 82f920798f Auto-completion for commands 2021-07-31 20:18:36 -05:00
Jaidyn Ann 51dc12236c Save weights of the chat view's SplitViews 2021-07-31 11:15:51 -05:00
Jaidyn Ann 89ff195c8d Set room topic/name through conversation view
If the user has permission to change a room's subject or name, they can
now edit the text views displaying them (toward the top of the window).
When enter is pressed, the changes will be sent to the protocol.

To do this, a BTextView subclass was added to libinterface
(splitting somewhat from SendTextView)― EnterTextView sends a message
containing the text to the given target when the user hits enter sans
modifiers.
2021-07-29 22:00:01 -05:00
Jaidyn Ann 909a68e595 Keep room subject to one line, bold room title 2021-07-29 19:39:22 -05:00
Jaidyn Ann 924f628c75 Add 'Create Account' message for first-time start-up 2021-07-28 22:18:00 -05:00
Jaidyn Ann 758bbb072a (libinterface) Add 'square' scaling option to BitmapView
When toggled, this option disallows the scaled-to view rect being
uneven.
2021-07-27 20:48:03 -05:00
Jaidyn Ann bba3d3d866 Sort conversation and user lists 2021-07-25 14:42:38 -05:00
Jaidyn Ann 5966df1a34 Print a 'date divider' when the day changes
I.E., if one message is sent on 2021-05-02 and the next on 2021-05-03, a
divider displaying the new date is printed before the second message.
2021-07-25 11:28:07 -05:00
Jaidyn Ann fff36dff6f Add 'when' to queued messages 2021-07-25 10:15:21 -05:00
Jaidyn Ann 987dc252d5 Translate more strings, update catkeys 2021-07-24 21:11:34 -05:00
Jaidyn Ann 43a7e7111d Auto-focus send textbox 2021-07-23 23:58:09 -05:00
Jaidyn Ann 9245dc7135 Auto-scroll ConversationView, fix RunView append 2021-07-21 12:10:20 -05:00
Jaidyn Ann 6f73db12b7 Highlight room list-items, auto-scroll in chat
When a new message is posted (or the user is messaged), the room's item
in the roomlist is now highlighted, like Vision.

Chat also auto-scrolls when new messages are posted.
2021-07-17 00:23:56 -05:00
Jaidyn Ann fe4d0661a7 Move notifications from ConversationView to Conversation itself 2021-07-16 16:28:58 -05:00
Jaidyn Ann e1ec602be8 Message/mention notifications
If the user's in a one-on-one chat, notify on every message― otherwise,
only notify when the user's name/ID is mentioned by another user.

Notifications should be managed by roomflags, but that's for another
time.
2021-07-15 18:01:58 -05:00
Jaidyn Ann 8a3f22d5e9 Move sendbox to conversation view, replace filter
The BTextBox used for sending messages has been moved from the main
window to individual ConversationViews, allowing seperate histories,
texts, etc., to exist in different conversations.

EditingFilter (a filter that hooked into MainWindow) was previously used
to field special key combos with this textbox, including "ENTER" for
sending, but this has been replaced with a new textview subclass
(SendTextView).
2021-07-08 16:07:03 -05:00
Jaidyn Ann f6a006dddc librunview/libsupport x86_gcc2 fixes 2021-06-30 14:25:58 -05:00
Jaidyn Ann de09ff9ad6 Rename Caya to Cardie 2021-06-22 01:06:00 -05:00
Jaidyn Ann 4ee453d0d6 Update room subject; accept user_name in OWN_CONTACT_INFO 2021-06-21 02:32:49 -05:00
Jaidyn Ann fbe6e66743 Change class names 2021-06-20 12:44:20 -05:00
Jaidyn Ann 077a01e8bf Print room 'join' and 'create' messages 2021-06-18 01:39:34 -05:00
Jaidyn Ann 46d6d0a0b0 Basic command storage and parsing
A new class was added (ChatCommand) to represent commands, which are
all stored in the Server iself.

A command can be assigned any arbitrary BMessage, and can be given
arguments with some semantic meaning (so far just "string" or "room
participant," etc).

"invite" and moderation commands were added (ban/kick/mute etc).
2021-06-15 00:22:35 -05:00
Jaidyn Ann a4e2b1dc5a Log receive-dates of messages
Fixes #15
2021-06-14 16:41:25 -05:00
Jaidyn Ann 1124e3cf2b Update ConversationView name when notified, resize JoinWindow 2021-06-13 01:25:28 -05:00
Jaidyn Ann 5b5840a79e Explicitly tie Conversations, Contacts, and Users to their ProtocolLoopers
Previously, all Conversations/Contacts/Users were stored in the Server,
each in their respective KeyMaps, identified solely by their
identifiers. This leads to the glaring problem of overlap― if the user
has multiple accounts, some users/rooms might be used or present in multiple
accounts at the same time.

Now, each accounts' Contacts, Conversations, and Users are stored in
its ProtocolLooper, making this overlap impossible. An oversight of only
allowing one user identifier to be stored (fMySelf) in Server was also fixed
this way.

This is the bulk of the work required for multi-account support― now,
the user can join the same XMPP room on two seperate accounts, and it
works perfectly.
2021-06-10 15:16:43 -05:00
Jaidyn Ann 242d29c3a6 Custom rgb_colors for use with RunView
Allows custom colors to be dictated to RunView directly from
CayaRenderView. Some colors that were reliant on hard-coded theme
have been replaced with system colors.
2021-06-08 07:34:10 -05:00
Jaidyn Ann 77d914312c Show users' joins/parts in chat view
New API messages were added to distinguish between a user leaving of
their own volition and being kicked/banned.

Messages are now shown in the chat view when a user leaves or or
kicked/banned, etc.
2021-06-07 00:03:15 -05:00
Jaidyn Ann dc3fdd65c8 Store chatlogs in binary and text formats
If chat logs are stored in an endless plain-text file, they're going to be a
pain to parse. If they're stored in a binary file, they're a pain for
the user to `grep` or go through manually, but they're easier to parse.

Why not both?

Logs are now stored with a BMessage (with BStringLists) in the 'logs'
attribute, and the plain-text logs in the file itself.

The attribute will only store 20 messages, but the file itself will be
appended to forever.

The logs directory also changed, from ~/config/settings/Caya/Cache/Logs
to ~/config/settings/Caya/Logs.

Useful functions for reading/writing messages to and from an attribute were
borrowed from BePodder's libfunky. :-)
2021-06-06 12:02:26 -05:00
Jaidyn Ann fe99f3d83a Show moderation items in right-click user menu, by perm 2021-06-06 01:49:11 -05:00
Jaidyn Ann effd010b46 Allow leaving/getting booted from rooms
Now the user can leave or be forced to leave a chat.
For this, two protocol API messages were added: IM_LEAVE_ROOM, and IM_ROOM_LEFT.

Aside from that, IM_ROOM_BAN_PARTICIPANT and IM_ROOM_KICK_PARTICIPANT
were added, though they aren't used yet.
2021-06-04 16:32:18 -05:00
Jaidyn Ann 89905fe23c Show/receive room subjects, show protocol icon in conversation view
The conversation view now displays the protocol icon and room subject.
Messages for receiving room names (IM_ROOM_NAME) and subjects
(IM_ROOM_SUBJECT) were added, and support for the latter was given to
the XMPP add-on.

New message APIs were added, and several (room-related) im_what values were
moved into the 150s/160s.

UserItem::_TintColor() was moved to CayaUtils, because it can be used in
several different contexts.
2021-06-04 13:57:04 -05:00
Jaidyn Ann dd298281e2 Changes to Notifier→Observer relations
The new Notifier→Observer relation chain:
	* Conversation → ConversationItem, ConversationView
	* User → UserListItem, UserInfoWindow, UserPopUp
	* Contact → RosterItem

These line up pretty intuitively― if something changes in the conversation, you
want the list item and view to change too.

But there's one more here that's less intuitive:
	* User → Conversation

If Conversation observes something from a user (i.e., status change), it
immediately knows to do one thing only: invalidate the user list, because
something's changed.
2021-06-03 23:39:50 -05:00
Jaidyn Ann 2e1190ae8d Fix handling of chat IDs
Don't show status notifications in group chats, make sure chat IDs are
found and set properly (on the XMPP side of things).
2021-06-03 20:24:34 -05:00
Jaidyn Ann 0581bf1df9 Use 'User' over 'Contact' where appropriate 2021-05-31 11:56:45 -05:00