Commit Graph

156 Enmetoj

Author SHA1 Message Date
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 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 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 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 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 71ae10dfc1 Change timestamp color 2021-08-19 17:31:43 -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 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 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 c492a46a65 Rename AccountManager to StatusManager 2021-08-16 10:40:18 -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 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 f5ba403e55 Improve auto-complete performance, include nicks
Previously, user auto-completion would only use the user IDs- now user
names are completed for also.
2021-08-11 12:07:11 -05:00
Jaidyn Ann 373dcb4a58 Protocol message tweaks, bump API version
Some chat protocol messages' names have been changed to more fitting or
consistent names― e.g., "IM_AVATAR_SET" to "IM_USER_AVATAR_SET", or
"IM_CONTACT_LIST_*" to "IM_ROSTER_*" (to agree with Cardie's usage of
the word).

The API version has been bumped― for the forseeable future (at least
several months, I promise!) no compatibility-breaking changes will be
introduced. Until then, any new feautures or message slots will be
additive and optional.
2021-08-08 21:01:42 -05:00
Jaidyn Ann 4bd821eee5 Account-toggling through Accounts menu 2021-08-07 17:37:16 -05:00
Jaidyn Ann 39e4fc9ac7 Make AccountsMenu use instance rather than index 2021-08-06 11:04:00 -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 f439ca9aa6 Document IM_SET_OWN_NICKNAME, bold nick 2021-08-03 16:05:57 -05:00
Jaidyn Ann 984f066070 Multi-account StatusView; set info per-account
Now the StatusView (bottom-left corner, right below the room list) can
be used to set the nickname and status not only for all accounts at
once, but for managing the status/nick of individual accounts.

AccountManager now can set details of a single account, too.

MainWindow is no longer an Observer (as it just passed the information
along to StatusView― now StatusView manages that itself).

NicknameTextControl was removed, not being in use.
2021-08-03 13:24:36 -05:00
Jaidyn Ann 47ca0f4169 Make all AccountsMenu items BitmapMenuItems
Now all account menus will have the pretty protocol icons to go with
them. :)

The icons are scaled to text-size so that they might be displayed in a
corresponding MenuButton, or maybe BMenuField at some point, and put
into the ImageCache.

The menu items do not have ownership of the bitmaps.
2021-08-03 10:29:19 -05:00
Jaidyn Ann 6d8be225ca Scaffolding of a multi-account StatusView
StatusView now allows the selecting of accounts through a MenuButton
with BitmapMenuItems― the button for selecting an account is nice and
discrete, just showing the bitmap of a protocol (in leiu of a label).
No functional changes, other than this menu.

I tried making all AccountsMenus use BitmapMenuItems, but that gets
unweildy pretty quickly― for now they remain in this menu. Maybe
optional ownership of bitmaps in BitmapMenuItems and caching of protocol
items would help.
2021-08-02 21:59:44 -05:00
Jaidyn Ann 9f05ce1136 Misc. tweaks, no functional change 2021-08-01 06:37:25 -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 2e3742d4e1 Chat history in send textbox
History of sent messages is now saved― if the user presses the up or
down arrows, history will be traversed in the textbox.
2021-07-31 18:50:04 -05:00
Jaidyn Ann 51dc12236c Save weights of the chat view's SplitViews 2021-07-31 11:15:51 -05:00
Jaidyn Ann ebc9d4041f Remove unused NotifyingTextView class 2021-07-29 22:47:30 -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 f038c492f7 Refactor preference saving/loading 2021-07-28 19:10:09 -05:00
Jaidyn Ann 37453ba2af Allow selection of non-contacts in roster windows
Windows using RosterView (like for the invitiation/new chat dialogues)
have a search-box for filtering between contacts. This allows the user
to type a user ID into this search-box that isn't a contact's ID, which
can then be selected as the user.

This makes common operations (inviting a user/adding a new contact)
a little easier.
2021-07-28 16:53:59 -05:00
Jaidyn Ann e33dd92375 Save account selection in account menus 2021-07-28 10:13:31 -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