Commit Graph

156 Enmetoj

Author SHA1 Message Date
Jaidyn Ann bea52c14be Roster list tweaks, auto-deselect 2021-07-25 17:27:04 -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 dfa92a8d9e Roster-windows scaling, truncate account names
In the AccountsMenu, item labels are now truncated to ~15 characters,
appending an ellipsis if the string is longer.
2021-07-24 15:45:20 -05:00
Jaidyn Ann 43a7e7111d Auto-focus send textbox 2021-07-23 23:58:09 -05:00
Jaidyn Ann 0ffe3e5ce8 Replace CreateAccountMenu() with dedicated class
CreateAccountMenu() is used to populate a BMenu with items corresponding
to the map of accounts provided to it― but when an account is disabled
or enabled, it can't update automatically.

A dedicated class, fAccountsMenu, now replaces it― it'll automatically
repopulate the list whenever the active accounts update.
2021-07-21 12:14:25 -05:00
Jaidyn Ann 9245dc7135 Auto-scroll ConversationView, fix RunView append 2021-07-21 12:10:20 -05:00
Jaidyn Ann 82c06bba25 Localization, init catkeys 2021-07-19 09:54:27 -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 e760818007 (librunview) Init new RenderView/RunView
Base-level replacement of the Vision-derived text RunView― a couple
important features supported by the replacee haven't been implemented yet,
including:
	* Right-click menu
	* URL-highlighting/selection
	* Emote support
2021-07-14 15:12:04 -05:00
Jaidyn Ann 7f30571703 Fix SmileTextRender crash
Fixes #22
2021-07-13 17:11:49 -05:00
Jaidyn Ann 5ec79ebbf5 Fix status view's avatar icon
The StatusView (below the roomlist) now shows a default icon if no
accounts have associated avatars, and will use an account's cached avatar
if available.
2021-07-13 14:43:48 -05:00
Jaidyn Ann f4df6d0d3b Typing auto-complete for usernames 2021-07-09 11:52:57 -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 52a580e03d Remove own user from contacts; fix roster bitmaps
It doesn't make sense to lump the user themself with their contacts
list― their Contact object is now stored seperately.

BBitmap loading for RosterItems are fixed, as well.

Fixes #33
2021-07-06 14:46:28 -05:00
Jaidyn Ann 1515ab0d00 Tweak permissions handling in UserListView 2021-07-06 13:47:37 -05:00
Jaidyn Ann 7db93bf596 Fix roster crash w/o protocol icon 2021-07-02 13:47:01 -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 b1920dad47 Move command/menu-item registration to call
Registration of custom chat commands and menu-items for protocols was
done by the IM_REGISTER_* messages, and is now done through direct calls
to the CayaProtocol object.

The new model for call/message for protocols is this: Temporary
information (chat messages, roster members, etc.) should be accessed
through messages. Relatively static data (protocol name, commands)
should be accessed through direct calls to the protocol object.
2021-06-20 01:24:34 -05:00
Jaidyn Ann d4f82dccc6 Removal of roster members
Now roster members can be deleted through the RosterEditWindow.

IM_CONTACT_LIST_REMOVED_CONTACT was renamed to
IM_CONTACT_LIST_CONTACT_REMOVED to fit style of other API messages.

Fixes #1.
2021-06-20 01:22:59 -05:00
Jaidyn Ann 9d72c53dd9 Split RosterWindow into per-account RosterView
Most of RosterWindow's special functions have been split into a special
BGroupView (including both the roster search-box and roster list),
RosterView.

This will give some more flexibility in other uses of the roster list.

In addition, RosterViews can be tied to a specific account by its
looper's instance ID, allowing it to either show all contacts (globally;
if the ID is set to -1) or only those of the specified account.

This can be useful, for example, when inviting contacts to a room―
you can only invite contacts that use the same protocol, and are
associated with your account, so showing all contacts doesn't make
sense.

The SearchBarTextControl class was removed, as it isn't particularly
necessary.
2021-06-18 16:41:09 -05:00
Jaidyn Ann 84eb2d68ba Slight template window tweaks 2021-06-18 14:18:45 -05:00
Jaidyn Ann 077a01e8bf Print room 'join' and 'create' messages 2021-06-18 01:39:34 -05:00
Jaidyn Ann 7c002d8fcc Room creation window; Catch-all template window
Explicit room-creation using protocol's own "room" template is now
supported.

Two new protocol API messages were added― IM_CREATE_ROOM and
IM_ROOM_CREATED, which are parallels to IM_CREATE_CHAT and
IM_CHAT_CREATED. Rather than the latter two, though, these are wholy
based on the "room" template― their slots are completely determined by
the protocol.

A generic "TemplateWindow" was created, which allows catch-all creation
of windows that leverage protocols' templates. It's used for the
room-creation window (Chat->New Room / Alt+N), for example.

At some point, it ideally should replace even the JoinRoom window, and
maybe others.
2021-06-18 01:13:02 -05:00
Jaidyn Ann d5aebac5c5 Custom chatlist pop-up items 2021-06-16 04:33:06 -05:00
Jaidyn Ann 66b8150eeb Basis for custom userlist pop-up menu items 2021-06-15 21:05:21 -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 577cfd1ae0 Show timestamps in RunView, with custom values
This makes it so RunView's built-in timestamps are used― but requires
that a time_t be sent with each newly-appended line. This allows for lines to
be backdated or forward-dated.
2021-06-14 14:42:38 -05:00
Jaidyn Ann 1124e3cf2b Update ConversationView name when notified, resize JoinWindow 2021-06-13 01:25:28 -05:00
Jaidyn Ann 9cd4ce18e1 Disable some menu items when no account is active
When no accounts are active, all items in the Menubar->Chat menu are
disabled, and some other menu items related to starting/managing chats
are disabled in other views.

One new message was added to the API― IM_PROTOCOL_READY, which tells
Caya that a given protocol has logged in and is ready to receive
messages (rather than just sending).

This is currently done in XMPP after the roster is loaded, which be a
process that stalls the protocol for a few seconds. IM_PROTOCOL_READY
should only be sent after those initial, potentially time-heavy
operations.
2021-06-12 16:13:52 -05:00
Jaidyn Ann dcc5e443d3 Support temporary disabling of accounts
Accounts can now be temporarily disabled (in a Pidgin-like style)
through Preferences->Accounts. Work is still required to allow
enabling/re-enabling of accounts on-the-fly, and for keeping an
account's disabled state persistent.
2021-06-11 20:33:28 -05:00
Jaidyn Ann 552e937e51 Group rooms in roomlist by account
The ConversationListView is now an BOutlineListView, and rooms are
added as subitems to the item of their associated account. Right now,
account items aren't selectable or useful.
2021-06-11 17:24:04 -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 5723f55433 Support sending invitations
Fixes #5
2021-06-08 21:43:41 -05:00
Jaidyn Ann 5ecf254ada Move window files to application/windows 2021-06-08 20:42:20 -05:00
Jaidyn Ann 3827787d38 Jabber support for receiving invitations 2021-06-08 19:59:22 -05:00
Jaidyn Ann 37512144a1 Receive room invitations, allow user to accept or deny
A BAlert is used to inform the user of room invitations― InviteDialogue―
and to send their response directly to the protocol's looper.

Some new protocol messages were added (and older ones were moved around
to compenstate)― IM_ROOM_SEND_INVITE, IM_ROOM_INVITE_REFUSED,
IM_ROOM_INVITE_RECEIVED, IM_ROOM_INVITE_ACCEPT, and
IM_ROOM_INVITE_REFUSE.
2021-06-08 15:32:04 -05:00
Jaidyn Ann bc2c211458 Show user-color in <> angle-brackets 2021-06-08 13:04:56 -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 fde681bbf4 Update conversation name & window title
Allow updating a conversation's name through IM_ROOM_NAME, and change
the Caya window's title whenever a new chat is selected.
2021-06-06 18:06:46 -05:00
Jaidyn Ann 260b36012e Support moderation (muting, kicking, etc)
Allow kicking/banning/muting/unmuting/deafening and undeafening through
the UserListView right-click menu (if permissions are sufficient).

Support for banning, kicking, and muting were added to the XMPP add-on―
deafening isn't supported, so is left out.
2021-06-06 17:51:22 -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 e00164c1aa Recolor user's item when status changes 2021-06-03 23:41:23 -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 ced04e613a Disallow deselecting conversation list item 2021-06-03 23:39:20 -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 ad1c7b5782 Receive lists and changes in room participants from protocols
Two new messages were added to the protocol API to do this:
M_ROOM_PARTICIPANTS, which can be used when someone joins a room, or
on joining a room to send a full list of users, and IM_ROOM_PARTICIPANT_LEFT,
for when a user has left the room/disconnected.

IM_SET_STATUS no longer assumes received data comes from contacts, but
any general user.

UserItem was made to reflect changes in the User's name.

Chat messages can now be reliably received in a given room. :)
2021-06-02 16:53:03 -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 70c6001189 Add Vision-like Window menu, conversation list tweaks
ALT-↑ and ALT-↓ change the active conversation, based on its position
in the main window's ConversationListView. If a conversation is
registered by the main window, and no other conversation is selected, it
is automatically selected.
2021-05-30 20:46:53 -05:00
Jaidyn Ann 71ae1456c6 Use system colors instead of hardcoded for CayaRenderView 2021-05-30 19:34:07 -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 641e8b1fb4 Correct spacing and sizes of main window views
Removes explicit setting of sizes in ConversationView and StatusView,
allowing them to be resized appropriately. Also rearranges StatusView
somewhat, so that it's more friendly to smaller sizes. (The avatar is
moved from being beside the status menu field to being beside the
nickname textbox.)
2021-05-30 12:30:57 -05:00
Jaidyn Ann f0492a995d Merge MainWindow and ChatWindow 2021-05-29 15:47:54 -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
Jaidyn Ann 13ea8fecdf Write conversation list, put it in main window
Now all active conversations will be listed in the main window, in a
ConversationListView. Clicking one of the items will open its
conversation window as you'd expect, etc.
2021-05-27 11:15:30 -05:00
Jaidyn Ann 3d020c4628 Populate conversations with logs, if any saved
Also adds a function to protocols to toggle this― if CayaProtocol::SaveLogs()
returns true, then local logs will be used to popualte conversation
windows. Otherwise, it's up to the protocol itself.

A new protocol IM_MESSAGE was also created, IM_LOGS_RECEIVED, which can
be used to populate conversations with old logs.
2021-05-24 19:12:42 -05:00
Jaidyn Ann 48d0b7bc96 Create Conversation class, use it instead of Contact for chats
This is a commit with it's foot in a lot of places, but:

The Conversation class was created as the abstraction of chats: All
ImMessages that are relevant to a conversation get routed through it,
meta-data on chats is stored in it (even if right now that's basically
limited to the user list and ID).

Server was given more methods to help accessing contacts―
ContactById(BString) and AddContact(Contact*). This better allows
Conversations to add and fetch Contacts as necessary. Right now, all
users in chats are treated as Contacts, so in the future creating an
independent userlist for Server (fUserMap?) would be useful.

Server also now stores all Conversations (fChatMap) and has some
convenience methods like for Contacts: Conversations(),
ConversationById(BString), and AddConversation(Conversation*).

CayaRenderView has been changed to not store user nicks, and will use
the appropriate nick of any arbitrarily-numbered user.

Users also have a map of all Conversations they are a part of
(fChatMap).

The Remove* methods of KeyMap now return the removed item.
2021-05-24 01:47:21 -05:00
Jaidyn Ann 7822ec0449 Split 'Contact' class into two
This dichotomy is useful and necessary in multi-user chats, so I split
Contact into a parent class, User. User should be used for generic
members of rooms, Contact used mainly with the roster.
2021-05-23 15:10:14 -05:00
Jaidyn Ann fc16b9b090 Rename ContactLinker to Contact 2021-05-23 14:39:07 -05:00
Jaidyn Ann df55e1d9f5 Switch from Jam to Make 2021-05-19 16:12:19 -05:00
Jérôme Duval 3d2f70c527 x86_64 build fix. 2017-01-30 07:19:59 +01:00
barrett 14fee07aeb A lot of style fixes, fixed a lot of warnings in RunView and Theme classes. 2012-10-18 20:59:15 +00:00
barrett 9cf1222142 Fixed a bug of the RosterListView menu. 2012-10-01 12:29:15 +00:00
barrett 8a27f1f3db Added the 'Start Conversation' menu to the RosterListView. Disabled the menus referring to unimplemented features. 2012-09-28 21:19:24 +00:00
barrett 133d3be911 Solved a double free. 2012-09-28 20:55:40 +00:00
barrett 5df2084053 Some style fixes and updated some copyrights. Removed the experimental code around SearchBarTextControl, and restored it to the previous functionality (i.e. no placeholder, until i finish my BTextControl patch to allow it), added also a 'instant search' like functionality to such class (every time you press a character the list is refreshed). This revision will be probably the next candidate for the Caya's optional package. 2012-09-25 21:45:29 +00:00
barrett d661379bc4 Fixed style and a warning, removed unuseful source file. 2012-05-29 00:44:02 +00:00
barrett 8ec3b19976 Added missing SearchBarTextcontrol class 2012-05-15 19:34:23 +00:00
barrett 088a1bb5f5 Fixed a AIM plugin build error introduced in recent revs. 2012-05-15 19:28:56 +00:00
barrett 2ed795031f Fixed another memory leak. 2012-05-15 17:31:31 +00:00
barrett 7540f60d24 Resolved a memory leak, removed unuseful commented code, CAYA_EXTENDED_AWAY replaced with CAYA_CUSTOM_STATUS and added CAYA_INVISIBLE. 2012-05-15 17:20:11 +00:00
barrett 710a3c6526 Updated the contacts list BMenuItem with a complete redesign of the item, added an experimental version of the Search BTextControl showing a text that disappear when the user click on it, updated the Nickname text control to be a BTextView, other minor updates already WIP like more organization of statuses. 2012-05-15 16:48:53 +00:00
barrett 9df2b09f45 Added a little bitmap at the left of the avatar in the contact list, that show the icon of the contact's protocol. Added a needed little method in the ContactLinker to get the contact protocol's bitmap as well. 2012-05-01 19:48:15 +00:00
barrett 0696ce92db Updated replicant menu icons. 2012-03-12 01:41:46 +00:00
barrett 19869c3970 Fixed code style, fixed a regression that caused a bad position when the chat window is created. 2012-03-12 00:40:37 +00:00
barrett 730e9d3d49 Added a simple WIP ContactInfoWindow that will be improved while we add new informations available in the ContactLiker, actually it's useful to get the contact id/email. 2012-03-11 15:11:29 +00:00
barrett 8d04f539c2 Added code that allow the deskbar replicant to be disabled/enabled from the preferences 2012-03-04 02:27:16 +00:00
barrett 68e42252d6 Fixed a little build issue and a warning 2012-02-25 02:46:55 +00:00
barrett 4aff3e3422 Added a new deskbar replicant with related classes and icons, disabled libdownload and curl depencency, fixed some warnings and style violations around the code 2011-12-14 23:36:27 +00:00
plfiorini c0a63c8f26 Layout API changes. Tested on Haiku r39074, I really don't know what is the first revision with this changes. 2010-10-24 06:27:09 +00:00
plfiorini 082f2ad34e Added libdownload from xeD. 2010-07-10 13:37:58 +00:00
plfiorini afe167b86b Bitmap as const argument. 2010-06-22 19:02:42 +00:00
plfiorini f560943e6f Handle IM_OWN_AVATAR_SET.
There's only one little problem that will probably be solved after Alpha1: if you have multiple accounts, all of them will set the avatar icon and the user will see just the last icon set.
2010-05-30 08:51:19 +00:00
plfiorini 88c5eedc9b Some style violations fixed. 2010-05-20 21:31:55 +00:00
urnenfeld 52b169b0ba Implement 'Ignore Emoticons' feature in preferences 2010-05-20 18:37:01 +00:00
plfiorini b314c7abd8 * Rewrote BitmapView's MinSize(), MaxSize() and PreferredSize() methods.
* Added BitmapView::Bitmap() method.
* BitmapView::SetBitmap() now doesn't resize the view anymore.
* BitmapView has now a minimum size of 32x32.
* Draw bitmap on BitmapView using B_FILTER_BITMAP_BILINEAR.
* StatusView sets now explicit max and preferred size to 50x50 for the avatar icon view and doesn't resize the bitmap explicitely.
* Small style violation fixes.
2010-05-20 18:11:32 +00:00