Commit Graph

211 Enmetoj

Author SHA1 Message Date
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 86f64cfa40 Ensure MUC nicks are respected 2021-06-10 16:44:35 -05:00
Jaidyn Ann 883d06c610 Remove custom draw method for AccountListItem 2021-06-10 16:28:39 -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 7767995400 Use account-based rather than protocol-based cache paths 2021-06-09 11:40:27 -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 c8a62610ca Use IM_USER_*_TYPING instead of IM_CONTACT_*_TYPING 2021-06-07 13:19:58 -05:00
Jaidyn Ann 26e99477fc Document protocol API 2021-06-07 11:45:30 -05:00
Jaidyn Ann 503c196d4f Generate unique foreground for each user 2021-06-07 00:56:26 -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 6e1ca87890 Support for "Roles" (user, moderator, admin, etc.)
Add scaffodling support for arbitrary roles and permission-based (and
varying!) UI.

A new class, Role, represents a user's role in a given room, with three
values:
	* The role's title
	* The role's permission-set
	* The role's priority

The permission set is a bitmask value for various permissions (e.g.,
PERM_WRITE, PERM_BAN, etc), and priority is position in the hierarchy.
A user with higher priority (and PERM_BAN) can ban a user with lower
priority, but not vice-versa. Two users with the same priority can't
ban/kick/mute each other, etc.

These permissions should be used to determine what UI elements are
displayed― if the user doesn't have permission to ban users, then a
"Ban" button shouldn't exist. If the user is muted, they shouldn't be
able to type. So on and so forth.

For now, permissions are sent with a IM_ROLECHANGE message and stored
by the Conversation, but aren't really in use yet.

This system should be flexible groundwork to account for the varying
administrative hierarchies and norms of different protocols.
2021-06-06 00:59:07 -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 3f62492b9c Change default window size 2021-06-01 22:12:01 -05:00
Jaidyn Ann 75de08a18b Create JoinWindow and protocol messages for joining rooms
Protocol messages was added to the API to allow joining abstract rooms
by their chat_id― IM_JOIN_ROOM and IM_ROOM_JOINED. To make room in
anticipation of future room-related calls, some messages' values have
been shifted.

A JoinWindow was created (found through [Chat→Join Room] or [Alt-J] in
the main window), to allow joining a room with this protocol message.
The user can select which account the room should be joined from through
a drop-down menu in the lower left-hand corner― a design I think could
be replicated in other parts of Caya well.

Path() and SetPath() in CayaProtocol were renamed to AddOnPath() and
SetAddOnPath() respectively. GetName() and SetName() were also added,
where "name" is the account name (aka the leaf of the protocols settings
path).

To Server, a new KeyMap was added for convenience (AccountInstances), to
associate these account names with their instance IDs.
2021-06-01 21:50:17 -05:00
Jaidyn Ann 5c5b180bbe Change RosterWindow's window type 2021-06-01 21:42:22 -05:00
Jaidyn Ann 2143de94c1 Remove unused WindowManager class 2021-05-31 16:08:50 -05:00
Jaidyn Ann 91d5b4e0dc Add own user to conversations' user lists
Really, only one line changed in _EnsureConversation()― the rest is
re-organizing the file.
2021-05-31 13:18:07 -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 ca2e05915d Tweak preferences layout 2021-05-30 22:04:45 -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 3e202e3609 Fix message-passing to roster window 2021-05-30 17:14:17 -05:00
Jaidyn Ann 5dbcfc1a52 Use same weight for all conversation views 2021-05-30 13:45:08 -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 0326cee687 Move roster into its own generic window
The roster list is now split from MainWindow into RosterWindow, which
can be used arbitrarily for selecting something from contacts. The
im_what, title, and target can be specified.

Right now it's in use under the Chat menu, "New chat…". Chats can only
have two members (DM/PM), so "New chat…" directly leads to the roster
list.

In the future, roster list might be extended to allow specification of
non-contact users based on their identifiers, or filtering based on
protocol/account― this could help it with "invites" to future rooms,
etc.

IM_CREATE_CHAT and IM_CHAT_CREATED were also added to the protocol API,
allowing a new chat to be explicitly created from Caya or the protocol.
2021-05-26 07:48:25 -05:00
Jaidyn Ann 5d9d16459f Add menubar to main window 2021-05-25 13:57:53 -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 cba947475c Log message recieve times 2021-05-24 14:48:25 -05:00
Jaidyn Ann 385bfbff35 Add text logging of chats
Now chat sessions are logged to ~/config/settings/Caya/Cache/Logs/.
2021-05-24 14:20:57 -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 4705d586f9 Show protocol icons in notifications
CayaProtocolAddOn now has the convenience functions ProtoIcon(),
ProtoSignature(), and ProtoFriendlySignature(), for getting info from
its default protocol.
2021-05-22 12:05:44 -05:00
Jaidyn Ann 6ca134f9f6 Load/Save account settings from correct paths 2021-05-21 15:52:33 -05:00
Jaidyn Ann 61a1f0baf1 Allow multiple protocols per add-on
Now an add-on can contain multiple protocols, and the protocol API has
changed. An add-on must now export protocol_count() and protocol_at(),
with the latter replacing protocol(). protocol_count() returning the
amount of protocols in a given add-on, and protocol_at(i) giving a
new CayaProtocol* "at" the given index.

CayaProtocol has also been changed, adding Signature(),
FriendlySignature(), Icon(), Path(), and SetPath(). The reasoning is
that different protocols (even within a single add-on) will have
different signatures and icons, so this data should be accessible from
the protocol itself.

CayaProtocolAddOn now has CountProtocols() and ProtocolAt(i), allowing
the accessing of multiple protocols. A CayaProtocolAddOn can be given a
default protocol index in the constructor, whose protocol will be
returned with Protocol(). Version() was also moved from CayaProtocol to
CayaProtocolAddOn.
2021-05-21 13:47:14 -05:00
Jaidyn Ann 53fe03d2c8 Generate protocols' settings templates by call 2021-05-20 09:32:52 -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
Ivan Gualandri b4d9d575a9 Task #12
* Add General section in Preference/Behavior
 * Don't prompt at quit option under General section
 * Show confirmation dialog on quit (if enabled)

Misc
 * Replace +/- in preferences Accounts with Add/Del
2015-10-02 04:17:54 +00:00
Ivan Gualandri fb5f1c38cf Task #12: add confirmation dialog 2015-09-29 08:59:40 +00:00
Barrett17 7f7c723e3b Remove custom ObjectList header. 2015-07-02 22:07:54 +00:00
Barrett17 e41a0338f1 Update Caya.rdef
Set a version for Caya.
2015-06-26 22:49:13 +02:00
Barrett17 2c2b808875 Remove SVN unneeded stuff. Update my own copyright. 2015-06-24 16:45:55 +00:00
Barrett17 8ed06e4de5 IconUtils is now Haiku public API remove it. 2015-06-24 16:23:04 +00:00
Barrett17 ae0652f3cc Finally cleaned up the buildsystem. 2015-06-24 15:31:54 +00:00
barrett17 007d2bda0a Initial rework of the build system to support the latest Haiku changes. Patch from Adrien Destgues included, Thanks! 2013-10-12 17:59:00 +00:00
Barrett 00440a3ffc Initial gcc2 support, patch from Haikuports, with a little modification by myself. Set the deskbar replicant show as default, and removed the gcc4 notice from preferences. 2013-07-31 22:34:52 +02:00
pisarzk@gmail.com ac7a745bf9 Add message count to notifications
Added unread message count to window title and also in notification.
Made one notification for each conversation, with new messages, the
count is simply being updated.
2013-07-30 20:54:22 +02:00
barrett 5e26a038dc Updated TODO in CayaPreferences. 2013-04-06 19:59:46 +00:00
barrett 007af3d89a Patch from Maciej Janiszewski which adds support for hiding offline contacts, message notifications and caya can now set the window title to unread state, all functions can be disabled from settings as well. Thanks\! 2013-04-06 19:47:04 +00:00
barrett 53c5c02d66 Set better proportions between the send and receive views of the ChatWindow. Made the window split more thin. 2013-01-04 17:37:53 +00:00
barrett 101006a459 Patch from Rene Gollent that add a split in the ChatWindow to resize the send and receive views. Thanks!! 2012-11-28 15:20:17 +00: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 92f2ee4547 Improved the behaviour to don't get focus when a message is received or the user is typing, from that rev the chat window will appear on the screen without leaving the focus of your current application. But there are two exeptions...when a window is created the first time or the user open it from the contacts list it will get focus. Other little fixes, changed variable names and style. 2012-06-07 16:46:07 +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 de33c1be80 Added code to show protocol's icon in the chat window. 2012-05-01 22:42:09 +00:00
barrett 493fed2f80 Setted the Person icon from haiku artwork as default contact icon. 2012-05-01 21:09:56 +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 9f4470c334 Modified the Replicant preferences string to notify that it's working only under gcc4hybrid atm, a development release will follow. 2012-03-24 23:54:58 +00:00
barrett 7318f6f28b Modified the CayaPreferencesData class to become a BFlattenable, this remove the limit of having a fixed-size buffer for string settings. 2012-03-24 14:56:00 +00:00
barrett b96ea4c6bf Fixed a bad behaviour showing and locating the chat windows. 2012-03-19 20:43:18 +00:00
barrett 2f142c0d67 Added replicant preferences view. 2012-03-13 22:57:04 +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 b80c9b2b11 Modified the preferences to select if the chat window should be auto raised when a message is received or when a user is typing, or both. This fix the issue #555. 2012-03-09 00:35:02 +00:00
barrett 8516381043 Enabled notifications using the BNotification API, including enable/disable settings. The plugins that support it are XMPP and MSN. Added another tab in the preferences window named Replicant and moved the replicant settings here. 2012-03-08 22:55:13 +00:00
barrett 2f417339f4 Added the code to lock the window looper before to update the avatar. 2012-03-08 01:17:32 +00:00
barrett 3f2f2783ff The personal message of a contact is now show in the chat window, added also the needed code in Server.cpp to update the windows. Solved a bug with the contact avatar that was causing Caya to crash. 2012-03-08 00:47:00 +00:00