Commit Graph

335 Enmetoj

Author SHA1 Message Date
Alexander von Gluck IV 8f5762219e application/windows: Guard from NULL dereference finding conversation
* Happens from the native matrix plugin on a large account
2023-12-22 08:37:19 -06:00
Jaidyn Ann dce82c2ba2 Use Server::Get(), clean up header usage
Instead of passing around pointers to the Server, Server::Get() returns
the server's pointer (simplifying some things a good bit).
As a result, headers have been cleaned up, and some redundant KeyMaps
have been placed in Maps.h.
2022-02-23 16:04:56 -06:00
Jaidyn Ann e092128200 Don't load multiple version of the same add-on
Now solely the one of highest priority is used (e.g.,
`non-packaged/add-ons/` over `system/add-ons/`).

Fixes #20
2022-02-23 12:11:17 -06:00
Jaidyn Ann b7b45a8db0 Add preference for hiding join/part messages 2022-02-21 18:33:46 -06:00
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 6f01818e8a Use BCardLayout instead of manual BView switching
Structures MainWindow around a Conversations→BLayoutItem map &
BCardLayout, instead of directly removing and adding ConversationViews
every time.
2022-02-20 21:00:56 -06:00
Jaidyn Ann eb60c94d68 Add user documentation (HTML)
… openable through menu-bar as Program→Help.

Following Humdinger's lead here, he did a bang-up job on Calendar's docs!
His code for opening documentation in Calendar is re-used here, too.
2022-02-20 10:58:59 -06:00
Jaidyn Ann 8d50a6b9a4 Pass relevant cache paths directly to add-ons
Now, instead of using Utils.cpp's AccountCachePath and AddOnCachePath,
and add-on should implement ChatProtocol::SetAccountCachePath and
ChatProtocol::SetAddOnCachePath.

In addition, most path-related functions in Utils now return BPaths― and
some of interest to chat add-ons can accept the path given by
ChatProtocol::SetAccountCachePath as the main argument.
2022-02-18 15:42:06 -06:00
Jaidyn Ann 866899eaad Get app name & signature from Make.pre/Make.post
It's useful to change the name and signature when you want to test
changes while using another instance of Chat-O-Matic.
2022-01-08 16:50:34 -06:00
Jaidyn Ann 4ad75cd807 Use system AboutWindow instead of custom 2021-12-14 10:28:15 -06:00
Jaidyn Ann 2f69f2fa04 No functional change; remove unused 'join' message
… also slight formatting tweaks, safer fetching of a Conversation's
list item in MainWindow, and an extra accessor for
ConversationListView.
2021-09-03 03:35:35 -05:00
Jaidyn Ann 3689f6cee3 Searching through chat with TextSearch 2021-08-31 22:04:19 -05:00
Jaidyn Ann e2d801b84b Save user name and color on message received
In Chat-O-Matic, text messages are enqueued by the ConversationView
and appended when the ConversationView becomes attached to the window
(editing a non-attached BTextView doesn't go well).

Previously, only the receive-time was added to the enqueued message― so
that if the view doesn't come into focus for a long while after message
receipt, the timestamp is still accurate. The user's nickname and color
weren't added as well, meaning that if the user left the room before the
message was appended, the ugly user-id and default user color would be
used instead.

This appends user_color and user_name.
2021-08-31 21:00:29 -05:00
Jaidyn Ann 6a160ced88 Sort room directory by account, 'Category' column
The room directory window now has an accounts menu, to allow the user to
filter rooms by account― and a "category" column has been added, which can
optionally be filled by the protocol for more semantic sorting of rooms
(Through "category" slot of IM_ROOM_DIRECTORY).
2021-08-31 20:31:39 -05:00
Jaidyn Ann f19bcba62a Add Room Directory window
This window (Chat→Room directory) is to be used for either a list of
publicly available rooms (in most protocols), or for a list of
joined-but-hidden rooms (as it'll used with libpurple, to list its
ChatBuddies).

Each room is sent individually from protocols using IM_ROOM_DIRECTORY
messages sent in response to a IM_GET_ROOM_DIRECTORY message.
2021-08-27 11:00:04 -05:00
Jaidyn Ann 5dbbb3a8ad (irc) Public room directory/list support 2021-08-27 00:25:41 -05:00
Jaidyn Ann 10b63e4138 x86 fix for ItemWeight use 2021-08-22 11:44:03 -05:00
Jaidyn Ann bcb92de53c (SendTextView) Check for important keys in each received byte 2021-08-22 11:36:35 -05:00
Jaidyn Ann 6e67401018 Remove unnecessary lib from Makefiles 2021-08-19 17:48:14 -05:00
Jaidyn Ann 71ae10dfc1 Change timestamp color 2021-08-19 17:31:43 -05:00
Jaidyn Ann cad278205c Fix contact-editing 2021-08-19 17:25:18 -05:00
Jaidyn Ann dd086dd455 Split AppConstants.h into UserStatus.h 2021-08-19 17:04:33 -05:00
Jaidyn Ann 8f159b7e8b Rename Cardie to Chat-O-Matic 2021-08-19 02:29:14 -05:00
Jaidyn Ann da8b0236c5 Add workspace-switching and window-raising options 2021-08-19 02:00:11 -05:00
Jaidyn Ann 38e9fca3be Prioritize native protocols in protocol list 2021-08-19 01:18:17 -05:00
Jaidyn Ann d8d89d245e Toggling of room flags through right-click menu
Room flags (e.g., whether or not to auto-join, whether notifications
should be sent on message receive) can now be toggled through a room's
right-click menu in the room-list.

Two new room flags were added for notifications as well― ROOM_NOTIFY_DM
and ROOM_NOTIFY_ALL. If ROOM_NOTIFY_DM is enabled, the user will receive
notifications if they are in a one-on-one chat. If ROOM_NOTIFY_ALL, they
will receive notifications on every message sent to the room.

The default menu items for the room's pop-up menu were moved from
Templates.rdef to be built into the app.

Everything else in Templates.rdef should follow suit― B_TRANSLATE
can't be used in rdef files!
2021-08-19 00:59:03 -05:00
Jaidyn Ann f486588c48 Add system beeps for message/mention receiving 2021-08-18 20:19:11 -05:00
Jaidyn Ann 901f7a8e05 Disable unusable settings, Notfications tab 2021-08-18 18:28:53 -05:00
Jaidyn Ann 6e89dbdab1 Better protocol status notifications
Now a notification is sent as soon as a protocol has been readied
(before connection established), and all status notifications use the
same message ID to avoid spamming the poor user.
2021-08-18 17:22:08 -05:00
Jaidyn Ann b2e17f57dc Fix avatar-loading 2021-08-18 17:00:11 -05:00
Jaidyn Ann f1464cb01c Search by user name and ID for chat commands 2021-08-18 15:15:56 -05:00
Jaidyn Ann 5e0782b553 Ensure implicit room-members are real
If a message/event is sent to a room that's tied to a user that hasn't
been formally declared (through IM_ROOM_PARTICIPANTS or
IM_ROOM_PARTICIPANT_JOINED), that user won't be unconditionally kept
anymore.

Now, after adding an implicit user, the participant list will be
requested again― upon receiving the list, all implicitly-defined users
will be removed. If they really existed to begin with, they should be
re-added quickly through this re-sending of IM_ROOM_PARTICIPANTS.

Ghosts should be treated as ghosts, not users.
2021-08-18 14:18:24 -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 c0580dfc17 Save disabling of accounts, make persistent
If the user disables an account, this saves it so that on any
subsequent start-ups, the account won't be connected until the user
explicitly re-enables it.

ProtocolSettings were reworked to allow for publicly loading/saving
settings from BMessages, rather than solely from BViews.

In addition, all program-side disabling, enabling, and toggling of
accounts has been consolidated into ProtocolManager. This makes life
easier for other parts of the program that have to do these things
anyway.
2021-08-16 11:58:27 -05:00
Jaidyn Ann c492a46a65 Rename AccountManager to StatusManager 2021-08-16 10:40:18 -05:00
Jaidyn Ann b380b6115c Fix chat creation with non-contact users 2021-08-15 20:34:30 -05:00
Jaidyn Ann 4da76e0256 Show 'Accounts' window when starting with no accounts 2021-08-15 15:45:53 -05:00
Jaidyn Ann 794d368c11 Make some dialogues floating windows 2021-08-15 15:45:28 -05:00
Jaidyn Ann ed7fe730cb Load protocols from any system add-on directory
… rather than soley "$APPDIR/protocols/".
The vague "protocols/" leaf was also renamed to "cardie/".
2021-08-15 00:55:16 -05:00
Jaidyn Ann ab6988d9ba Ensure selection & add account buffer to chat list
Ensures that an item in the chat list is always selected (as long as
there are items to be selected), and that an account's "buffer" (fake
conversation) is added immediately after connection, and removed
immediately after disconnection.
2021-08-14 23:37:59 -05:00
Jaidyn Ann 10bb155b94 Fix off-zero auto-completion 2021-08-14 22:10:39 -05:00
Jaidyn Ann 5b4d8c9413 Disallow right-clicking on ConversationAccountItems 2021-08-14 21:25:46 -05:00
Jaidyn Ann e6f9c3e085 Notification and buffer message on disconnect/reconnect 2021-08-14 11:57:42 -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