Commit Graph

24 Enmetoj

Author SHA1 Message Date
Jaidyn Ann ce4d3c2a26 Fix checking of ConversationView's visibility
Since ConversationViews were manually removed/added previously, now
that a BCardLayout is used, the visibility-detection/some actions
change (e.g., using BView::Show instead of BView::AttachedToWindow).
2022-02-21 18:09:54 -06: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 3861fa718d Remove unused APP_*_CHAT_WINDOW messages 2021-08-05 21:05:59 -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 924f628c75 Add 'Create Account' message for first-time start-up 2021-07-28 22:18:00 -05:00
Jaidyn Ann fff36dff6f Add 'when' to queued messages 2021-07-25 10:15:21 -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 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 fbe6e66743 Change class names 2021-06-20 12:44:20 -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 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 0581bf1df9 Use 'User' over 'Contact' where appropriate 2021-05-31 11:56:45 -05:00
Jaidyn Ann 63d8bbef26 Add user-list to the conversation view, menu tweaks
UserListView and UserItem were added as the backbone of the user-list,
and the (currently unused) Caya message CAYA_SEND_INVITE was established
for inviting users to rooms.

Some menus were reworked (e.g., pop-ups of the RosterListView) or
generally tweaked to be more sensical or consistent.
2021-05-31 10:50:43 -05:00
Jaidyn Ann cd3eb3cbf3 Re-enable logging, make appending messages to ConversationView safer
Now all instances of sending messages (bar status changes) to a
conversation's CayaRenderView only happen when attached to the window.

Messages sent by user appear after the protocol confirms it's been sent
(IM_MESSAGE_SENT), rather than appearing right after the user sends it
to the protocol (IM_SEND_MESSAGE).

Logs are now re-enabled (since they can safely be appended under any
circumstance).
2021-05-30 19:21:29 -05:00
Jaidyn Ann b9d120a8f6 Use a single ChatWindow for all conversations
All chats now stay in a single window, which removes and switches its
current ConversationView with the appropriate one using
Conversation::GetView().

This is a stepping-stone to merging the ChatWindow into the MainWindow.
2021-05-28 22:26:32 -05:00
Jaidyn Ann 3ace145248 Move bulk of chat window into a dedicated ConvesationView
This will help to move to a single-window layout, instead of having a
dedicated window per-chat.
2021-05-28 08:38:33 -05:00