Commit Graph

172 Enmetoj

Author SHA1 Message Date
Jaidyn Ann 26e99477fc Document protocol API 2021-06-07 11:45:30 -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 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 2f1aee3220 XMPP support for IM_ROOM_LEAVE/IM_ROOM_LEFT 2021-06-04 16:34:25 -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 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 a89bec40a3 Sending messages to MUCs, proper logging 2021-06-03 14:25:51 -05:00
Jaidyn Ann b66ea722b0 Send MUC participants on join, and send participants' status 2021-06-02 16:58:29 -05:00
Jaidyn Ann 061489ba2e Recieve messages from MUC rooms 2021-06-02 12:34:00 -05:00
Jaidyn Ann 770f7eaee3 Support for joining MUCs; Stanza error-handling
Adds basic support for joining MUCs― so basic that Caya won't even tell
the user they've joined, and messages can't be received.

The scaffolding for further MUC development was added, and some
much-needed error-handling for stanzas has been created.
2021-06-01 21:53:50 -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 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 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 96195039e0 Use gloox'es jidJID() instead of deprecated jid() 2021-05-19 16:13:24 -05:00
Jaidyn Ann df55e1d9f5 Switch from Jam to Make 2021-05-19 16:12:19 -05:00
Jaidyn Ann c6c1bb349a Remove obselete libraries/protocols 2021-05-19 15:48:07 -05:00
Jérôme Duval ba991ee13c remove msn from the build 2017-01-30 07:22:31 +01:00
Dario Casalinuovo 6de2682326 MSNP: Fix bad return value 2015-07-21 03:00:28 +02: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
Barrett 830f1216f5 Merging caya and caya-gpl-protocols 2013-07-29 16:58:19 +02:00
barrett 088a1bb5f5 Fixed a AIM plugin build error introduced in recent revs. 2012-05-15 19:28:56 +00:00
barrett ee0669cfd1 Updated statuses accordingly with the recent Caya changes. 2012-05-15 17:51:03 +00:00
barrett aa93e9ad96 Resolved a conflict between the Yahoo protocol and MSN that was causing both protocols to do not work, removed some annoying error message notifications that are not valid with Caya. Actually, the idea is to reduce the use of pop-up window in favor of notifications. 2012-03-20 23:32:18 +00:00
barrett 5cf285f588 Deletion of the avatar looper/messagerunner in the destructor, moved a piece of code to set the status before to send the list. 2012-03-20 02:13:35 +00:00
barrett 267bc512a6 Added AIM Protocol login / logout notifications, patch from Jeremiah Holt, Thanks\!. 2012-03-19 00:33:26 +00:00
barrett 0e3579b9c3 Added Yahoo Protocol login/logout notifications, patch from Jeremiah Holt, Thanks\! 2012-03-19 00:29:05 +00:00
barrett c5f730a8b3 Solved a little regression that was causing AIM to crash. 2012-03-17 14:01:00 +00:00
barrett d237f75f61 Modified the BMessageRunner to stop sending messages when it's unneeded, added connect/disconnect notifications code. 2012-03-08 02:58:21 +00:00
barrett fd546ea9ae Added check code to prevent the protocol crashing in certain situations. 2012-03-08 01:38:55 +00:00
barrett 0237a48a53 Uncommented AvatarLooper::MessageReceived() code used to send unhandled message to the constructor, solved a regression that was causing fSwitchboardList to be empty. 2012-03-07 19:24:59 +00:00
barrett 75e9859517 Preliminary MSN support is working and enabled by the fault in the plugin with that commit. 2012-03-06 01:30:04 +00:00
barrett fd1b46acae Removed superfluous server and resource defs in the settings template of the msn protocol. 2012-03-04 02:32:08 +00:00
barrett b518538872 Solved some warnings, removed unuseful commented code, little style fixes, general work around the implementation of the MSN avatars...the code was polished for the next step. 2012-03-03 19:22:47 +00:00
barrett d86051bdfe Removed __declspec from msn and yahoo plugins, updated libmsn to the latest version 2012-02-26 03:35:45 +00:00
barrett 9c43174dce AIM : Removed _declspec and removed a unuseful parameter, both were causing warnings. Replaced List<> a std::list wrapper, with BObjectList and removed the _TR macro in ProtocolSettings that is apparently not doing anything. 2012-02-25 20:33:28 +00:00
barrett f0c5c07a2e Added a first core of the avatars cache. Solved a regression with personal message. 2011-04-26 21:33:17 +00:00
barrett 55d162b108 Missing MSNContainer class 2011-04-23 23:01:25 +00:00
barrett 10131151f2 MSN Plugin, initial avatars support added 2011-04-23 23:00:06 +00:00
barrett 7800069ca2 The yahoo protocol is stable enough to be included in the trunk. 2011-04-19 22:41:39 +00:00
barrett ccb2ba04e9 Solved a problem with MSN_STATUS_IDLE 2011-04-19 12:44:45 +00:00
barrett c92a7038d0 cleanup...now the xmpp thread will not suck your cpu 2011-04-09 02:35:20 +00:00
barrett 556436ef77 ÂÂsolved compiler warning, removed superfluous messages from plugin 2010-10-09 04:21:38 +00:00
barrett 297fd986f8 momoving msn plugin to caya gpl plugins subproject 2010-10-09 03:36:24 +00:00
barrett dc31fbfd67 moving msn plugin to caya gpl plugins subproject 2010-10-09 03:34:22 +00:00
plfiorini 6ef31b44f1 Check protocol add-ons API version 2010-07-10 19:28:29 +00:00
plfiorini a9df932fec Implemented the Version() method. 2010-07-10 19:27:32 +00:00
plfiorini 5e4e5d68c4 Changed label to username settings. 2010-05-30 21:20:34 +00:00
plfiorini 7a89509b9f Error handling. 2010-05-30 20:50:04 +00:00
plfiorini 6478101579 Send information notifications instead of progress notifications when we are connected or disconnected to the server. 2010-05-30 18:57:19 +00:00
plfiorini 068cd849ae Using _EXPORT instead of __declspec(dllexport), fixes warning. 2010-05-30 18:46:16 +00:00
plfiorini 5cf1ffadfb Use _SendMessage() to send messages from protocol to Caya because it will always add the "protocol" field. 2010-05-30 12:30:47 +00:00
plfiorini 7757c0b64c Progress notification for connect and disconnect. 2010-05-30 12:17:59 +00:00
plfiorini 225957b2f6 Support avatar images for contacts. 2010-05-30 04:26:36 +00:00
plfiorini 926b90a3c5 Renamed jabber folder to xmpp. 2010-05-28 21:25:14 +00:00
plfiorini 659d45a82c Removed gtalk, facebook and libjabber. 2010-05-28 21:00:30 +00:00
plfiorini 435efc7c9f * Renamed Jabber to JabberHandler as a base class for XMPP protocols.
* Added gtalk and facebook.
2010-05-28 20:41:58 +00:00
plfiorini 0706699184 Import Jabber GPL'ed protocol (beware, it crashes but it's too late to find out why). 2010-05-28 01:04:31 +00:00
plfiorini c777593fa7 Fix from Rene Gollent. 2010-05-27 07:31:03 +00:00
plfiorini cc898075d2 Fixed what mankind will remember as the 'Massive Breakage due to "blind svn merge"'. 2010-05-19 21:36:36 +00:00
plfiorini e3253f9995 Fix what I left broken with last commit on trunk. :P 2010-05-19 20:56:01 +00:00
plfiorini 2ee14f4c14 * Some style violation fixes.
* Code aligned to recent multiprotocol branch changes.
* Fixed crash when Server filters IM_STATUS_SET messages and ContactLinker is NULL.
2010-05-19 20:37:26 +00:00
plfiorini 4bdc37a60e Merged multiprotocol branch with trunk. 2010-05-16 21:02:50 +00:00
plfiorini c599c12c7f Cleaning up the AIM code base and adding the right icon from IM Kit. 2010-05-12 21:48:47 +00:00
plfiorini 8d6d06dbfe Adding AIM protocol from Alexander Botero-Lowry, but it needs polishing. 2010-05-12 20:42:46 +00:00
plfiorini fb1d2910a2 Added resource setting to the template. 2010-05-08 00:22:38 +00:00
plfiorini 0bf4b59922 Usual SVN tree (branches, tags, trunk). 2010-05-07 09:47:10 +00:00