- All notable changes to
Messengerwill be documented in this file.
- Atomic locks when starting or ending a call.
- Uploaded file name sanitization.
FileServiceno longer names a file based on atypespecified.- Starting and ending a call no longer use simple cache keys for their lockouts. Atomic locks are now used.
- Due to this, your cache driver must support atomic locks. See: https://laravel.com/docs/9.x/cache#atomic-locks
- Deprecated:
setCallLockoutmethod in theNewCallAction. This method now does nothing and is no longer needed.setTypemethod inFileService. This method now does nothing and is no longer needed.- All
TYPE_constants inFileService.
- Updated dependencies for
laravel ^9.xandPHP ^8.0.2.
getEmptyResponsetoBaseMessengerAction.
- All
DELETEroutes now only return an empty response with a204status code. (Previously some returned json resources or json success messages) - Renamed
getMessageResponsetogetSuccessResponseinBaseMessengerAction.
Handler.phpto decorate the exception handler resolved from the container.
- All rate-limiting middleware is now defined directly on the routes and not within controller constructors.
- Knocking uses a proper rate limiter now, throwing a throttle exception with the remaining seconds.
ModelNotFoundexceptions thrown from messenger routes will be transformed into a sanitized message.- Routes now use the
scopedBindingsflag instead of defining them per route. - Minimum laravel version bumped to
^8.70.
- Knock timeout setter/getter from
Thread.phpmodel.
getDTOstatic method on bothBotActionHandlerandPackagedBot.testResolvestatic method onBotActionHandlerfor aid in testing.testInstallsstatic method onPackagedBotfor aid in testing.authorizeHandlerandauthorizePackagedBotmethods onMessengerBots.shouldAuthorizemethod onMessengerBots, allowing you to disable handler / bot package authorization for a single request cycle.- Singular methods
getHandlerandgetPackagedBotonMessengerBotsfor single resource fetches.
Uuidstrait now sets theincrementingandkeyTypeproperties for models that use it.- Moved the namespace for the base
MessengerCollection. - Consolidated bot handler / packaged bot authorization handling methods.
GhostUserprimary ID is now static/unchanging.
PackagedBotDTO.phpnow applies filters for authorization, can install, and already installed.- When viewing
PackagedBotDTO.php's through a request,installedandalready_installedare now returned, wherealready_installedshows handlers flagged as unique that already exists in the thread. - Various testing refactor and docblock improvements.
use_absolute_routesconfig, default of false.Messenger::shouldUseAbsoluteRoutes()method you can override on the fly.- When
Messenger::flush()is called, the absolute route flag will be reset to the initial config value.
- When
BotActionHandler's attached to aPackagedBotwill now be authorized when viewing / installing aPackagedBot.FileServicenow prefixes an image with its original file name during the renaming process.
- Packaged Bots feature! Please check the chat-bots documentation for more information.
Helpers::forProviderInCollection()method.BOT_PACKAGE_INSTALLEDsystem message type.php artisan messenger:make:packaged-bot {name}command.- More state helpers on model factories.
BotActionHandlerclass moved fromRTipppin\Messenger\Actions\BotstoRTippin\Messenger\Support.- The
BotActionHandleroriginal is now deprecated and extends the new class's location.
- The
- Renamed
MessengerBots::getHandlersDTO()toMessengerBots::getHandlers(). - Renamed
MessengerBots::getAlises()toMessengerBots::getHandlerAliases(). - Renamed
BotActionmethodgetHandlersDTOtogetHandler. - A bot handler flagged as unique may only be attached to a single bot in a group thread, not once per bot.
forProvidercollection macro.- Redundant interfaces
Action,ActionHandler, andBroadcastEvent.
MessengerBots::MATCH_ANYmatch method.- When using
MATCH_ANY, triggers are ignored and a handler will be handled for any message sent.
- When using
BotHandlerResolverServiceto handle resolving / validatingBotActiondata for storing/updating.BotAction::formatTriggers()helper, logic relocated fromMessengerBots.BotActionHandlerDTO,ResolvedBotHandlerDTO, andMessengerProviderDTOto structure internal data arrays.MessengerBots::getHandlersDTO()returns a collection or single instance ofBotActionHandlerDTO.
BotActionHandledEventtriggerproperty can now bestring|null.MessengerBots::getHandlerSettings()deprecated. UsegetHandlersDTO.MessengerBots::getAuthorizedHandlers()now returns a collection ofBotActionHandlerDTOinstances.
MessengerBots::resolveHandlerData()method.
BroadcastFailedEventwill be dispatched when a broadcast fails and throws an exception.
- Relocated knock cache methods to the
Threadmodel fromSendKnockaction class. - Various code improvements.
- Caching on
BotActioncollection for a group thread when jobs process matching bot triggers against messages sent.
- All bot action classes will clear the
BotActioncache. - Enforce checking child to parent relation keys in policies.
- All route model bindings are now scoped.
- Job class properties now have
publicvisibility.
- Caching to a
Messages'sreplyTorelation. - Updating or archiving a message will reset the
replyTocache key.
- Moved cache methods and keys to model helpers.
Botname method now useshtmlspecialchars.
CallHeartbeat.phpaction class.
- Constants on
MessengerBotsclass for all bot matching methods. getParsedMessageandgetParsedWordshelpers onBotActionHandler|ActionHandler.php artisan messenger:make:bot {name}command.bodystate helper onMessageFactory.
- Renamed
setDataForMessagetosetDataForHandleronBotActionHandler|ActionHandler. - Implemented helpers on the
BotAction.phpmodel for triggers and match method that take into account a handler classes overrides before using what is stored in the database.
- Caching for a participants last seen message.
thread_verificationsconfig section which defines whether friendship checks are enabled when creating a private thread or adding participants to a group thread.
'thread_verifications' => [
'private_thread_friendship' => env('MESSENGER_VERIFY_PRIVATE_THREAD_FRIENDSHIP', true),
'group_thread_friendship' => env('MESSENGER_VERIFY_GROUP_THREAD_FRIENDSHIP', true),
],- Various code improvements and bug fixes.
- Video message upload support
Message::VIDEO_MESSAGE | type 4.StoreVideoMessageaction.video()method toMessengerComposermessenger:purge:videoscommand and accompanying job/action.- Private threads can be created using a video message.
assetsprefix on our asset route names (not paths).- Eager loading of message reactions for message collections.
- This update is backwards compatible, however, video messages will be disabled by default until you add the new nested values to your published
messenger.phpconfigsfilesarray.
'files' => [
// Add new message_videos
'message_videos' => [
'upload' => env('MESSENGER_MESSAGE_VIDEO_UPLOAD', true),
'size_limit' => env('MESSENGER_MESSAGE_VIDEO_SIZE_LIMIT', 15360),
'mime_types' => env('MESSENGER_MESSAGE_VIDEO_MIME_TYPES', 'avi,mp4,ogv,webm,3gp,3g2,wmv,mov'),
],
],MessengerComposerwill now emit events/broadcast when a new thread is created. The new thread will also now be marked as pending if the two providers are not friends.storage.threads.diskconfig default changed topublicfrommessenger.- Deprecated
getProviderOnlineStatusVerbosefrom ourMessengerProviderinterface. - Moved
shouldUseUuidsstatic method fromMessengerBotstoMessengerclass. - CS fixer updates.
FriendRemovedBroadcastwhen a friend is removed.withoutEventsboolean flag onMessengerComposer::silent(bool $withoutEvents = false)to disable both broadcast and events for an action.
AuthenticateOptional::class|auth.optionalmiddleware deprecated.Invitemodel'scodeincreased to 10 characters in length on creation.- Code cleanup / typo fixes.
- New constants on
Thread,Participant,Message, andCallmodels. - New constants on
FriendDriverandMessengerProviderinterfaces. - New constants on
FileService.
Definitionssupport class has been deprecated.- All constants from
Definitionshave been moved to their respective model/interface.
NullFriendBrokerstand-in class forFriendDriver.setFriendDrivermethod on our coreMessengerservice.AttachMessengersCommandto attach our messenger models with existing records.
- New
scopedimplementation for setting/unsetting theMessengerProvider. MethodssetScopedProvider()andunsetScopedProvider().- A scoped provider will keep any prior provider set in memory, such as an authenticated user, while returning the scoped provider to any subsequent calls to
getProvider(). - When unsetting a scoped provider, it will set the prior provider back to the active provider, if one was set.
- This is mostly used internally, and on our
MessengerComposerclass, to avoid conflicts on queues as ourMessengerservice is a singleton.
- A scoped provider will keep any prior provider set in memory, such as an authenticated user, while returning the scoped provider to any subsequent calls to
- Interfaces
Ownerable,HasPresenceChannelfor use with internal models and broadcasting.
- Our broadcaster and push notification service will now reset their states after execution.
- When broadcasting, we now enforce unique channels, filtering any duplicates before firing any broadcast.
- Updated policy allow/deny responses.
- Unsetting the
MessengerProviderwill now flush any activeFriendDriverfrom the container. - Various bug fixes and request lifecycle improvements.
- Fixed
ThreadArchivedMessageto not broadcast the system message, as participants would have already received the archived broadcast. - Updated policy allow/deny responses.
messenger:installcommand will now ask for confirmation, and has the ability to overwrite our published config file, settingprovider_uuidsto true, using the--uuidsflag. It will also ask if you want to migrate after publishing.- General code improvements.
flush()method onMessengerandMessengerBots.BaseMessengerJoball job classes now extend.FlushMessengerServicesjob middleware which flushes messenger and bot services. This fixes/prevents a queue worker's process from having one job alter our singleton's state, impacting a following job that calls to our singleton.
setVideoDriverandsetBroadcastDriverfixed to usebindand notsingleton.- Our
NullVideoBrokerwill be set as our defaultVideoDriver. ProcessMessageTriggersproperly flushes the active handler on our bots service between each match.
- Removed deprecated
ViewPortalControlleras it now resides in our UI addon package. (182a37a)
- Improved docs. (9f6ab30)
messengerComposer()helper. (13b4d9d)getUniqueHandlerClassestoMessengerBots.validUniqueActionsrelationship on theBotmodel.- Expanded docs.
- When viewing
add-handlersfor a bot, we now filter out handlers marked as unique that are already attached to the bot. (d643df3)
threads.subjectandbots.namecolumns locked to max length of255.Threadsubjectvalidation now allows min length of 2 and max length of255.Messagetemporary_idpost value set to max length of255.- Commit (0b96afd)
JanusServerandVideoRoomService.janusconfig file.JanusBrokervideo driver.- Commit (4ced3a9)
- If you were already using our provided janus, you must now create and register your own JanusBroker
- Install our new janus-client package and update your broker accordingly to use the packages create/destroy for
VideoRoom.
messages.bodyandmessage_edits.bodycolumns to allow nullable. (2ebe8ac)EmojiInterface,BotMatchingService,MessageTransformer, andMessengerComposernow allow null for message body.
- Event subscribers will now always be registered, but conditionally check whether to handle events triggered. (avoids being disabled from config and not enabling dynamically when they were not registered in our service provider). (692256b)
- Using core php method
is_subclass_ofinstead of my custom reflection checks. (303e12d) - Calls down command now re-sets the down cache lock when triggered while calls already down. (44b768a)
ProvidersCacheCommandandProvidersClearCommandSearchablecontract.checkImplementsInterfaceandcheckIsSubclassOffromHelpersclass.- Commit (a4866a0)
getProviderSettingspublic static method to theMessengerProvidercontract.getProviderSettingsdefault added to theMessageabletrait.MessengerServiceProviderstub we now publish to the end users project. We also insert the provider to theapp.phpproviders array.
- Messenger
getAllMessengerProvidersrenamed togetAllProviders. - Messenger
setMessengerProvidersrenamed toregisterProviders. - MessengerBots
setHandlersrenamed toregisterHandlers.setHandlerskept but deprecated. - Messenger
getConfigno longer returns providers. - Provider interactions reversed. Now you set the classes you do not want the provider to interact with.
messenger:publishcommand renamed tomessenger:install.
providersarray from config.getFriendableForCurrentProviderfrom Messenger.ProvidersCacheCommandandProvidersClearCommanddeprecated. Providers caching removed from MessengerConfig.Searchablecontract deprecated.ProvidersVerification.phpclass.
message_size_limitto our config. (bb87b51)isGroupAdminproperty to theBotActionHandler. (1f6f51b)
- Implemented
message_size_limitto any message send or edit message request. - Forward
isGroupAdminfrom event -> process triggers toBotActionHandler. Interface updated.
getFirstValidEmojiShortcodemethod to the Emoji interface. (cc28e63)emitTyping,emitStopTyping,emitRead, andreadmethods toMessengerComposer. (36ccbcf)- PresenceEvents class to handle getting/setting client presence events.
- Improve (reduced) queries for message reactions. (189b1cf)
- Methods for checking reflection moved from trait to helper class as static methods. (c06f299 & 1b5ee7d)
ChecksReflectiontrait.setAction,setThread,setMessagemethods fromBotActionHandler. Replaced withsetDataForMessage. (4a5acdf)
BotActionHandledEventandBotActionFailedEvent. (d5ab76c)Botsapi documentation.
- Add index to column
bot_actions.handler - Moved logic for executing action handlers to
ProcessMessageTriggeraction class, and using new query. (39664d6) - When a bot handler fails / throws exception, the exception will not be reported. The action and exception will be dispatched
in the new
BotActionFailedEventthat can be listened to by the end user. - Fixed bot and bot action cooldowns to cast as integer.
- MessengerComposer class and facade. Easily build to/from and message/image/document/audio/reaction/knock.
composer()method to the core BotActionHandler
- Bug fix for bots when end user providers using INT keys and not UUIDs. Bot primary key now matches end
users messenger config
provider_uuids. (9c3ae1a) - Improved query performance for scopes providers. (f093d23)
concatBuilderfrom ScopesProviders trait.
- System messages for bot events (create, delete, avatar, rename).
- Proper store and destroy group thread avatar.
avatarsanddefault_thread_avatarinfilesconfig array.- New methods for avatars (provider, thread, bot)
- Please see config: messenger.php
- Janus server bug fixes with improper types properties when http call fails.
- Avatars (provider, thread, bot) share one config for size/mimes.
- Switched main queries used for locating threads/calls from using
whereHasto custom scope usingjoin.
- Random of 5 default group thread avatars. Only one set now.
thread_avatarsprovider_avatarsdefault_thread_avatarsfromfilesconfig array.- Following methods from Messenger:
getThreadAvatarSizeLimitsetThreadAvatarSizeLimitgetThreadAvatarMimeTypessetThreadAvatarMimeTypesisProviderAvatarRemovalEnabledsetProviderAvatarRemovalgetProviderAvatarSizeLimitsetProviderAvatarSizeLimitgetProviderAvatarMimeTypessetProviderAvatarMimeTypes
assetsconfig array under theroutingconfig section.assets.phprouting file.senderIptoNewMessageEvent. Forward IP to bot handlers.
- Assets (avatars/images/documents) no longer require authorization.
- Removed the bool parameter for api on the method
getProviderAvatarRoute()from theMessengerProvidercontract.
- Assets, views, web routes. Relocated to Messenger UI addon.
- All API prefixed routes and responses for assets (images, documents, audio, avatars).
site_namefrom config.webfromroutingconfig.provider_avatarfromroutingconfig.getSiteName()getWebEndpoint()isWebRoutesEnabled()andgetSocketEndpoint()methods from Messenger.
- Group thread bots feature!
BotandBotActionmodels.botsconfig arraydefault_bot_avatarto files config array.- Migrations for
botsandbot_actions. MessengerBotsfacade.- Default bot avatar in published images.
- global helpers for
broadcaster()andbots(). messenger:purge:botscommand.
- Thread
activeCallrelationship to using properofManyquery. messenger:providers:cachecommand caches providers with the merged bot provider.- Switched injecting cache manager and config repository to using facade/helpers.
- See above for
messenger.phpconfig changes. - upgraded UI packages, edited views, and recompiled assets.
SystemFeaturesResourceimplementation changed to using a direct call to the messenger service class.- When saving a group threads settings or updating a participants permissions, feature disabled values will be ignored.
SystemFeaturesResourcejson resource.
- Event subscribers for calling and system messages. More config for these to toggle on or off, set queued, and queue channel.
- Config option to toggle system messages on or off.
- boolean column
chat_botsonthreadstable. - boolean column
manage_botsonparticipantstable. SystemFeaturesResourceattached to threads collection and thread resource. Shows the current system feature statuses.- Groundwork for upcoming bots feature.
- Default broadcast driver set in the service provider.
push_notificationsin config no longer nested array.
- Drivers section from config.
- ALL queued listeners and the Event => Listener map.
getBroadcastDriver()andgetVideoDriver()methods from messenger.
- Any models using
protected $dateswere switched to using cast fordatetime - Storing invite now accepts null or any valid timestamp more than 5 minutes in the future, for the
expirestime.
- Using new
latestOfManyeloquent call to gather the latest message for each thread in eager loads.
- composer.json now locked to laravel ^8.42
- Rename relation on thread
recentMessagetolatestMessage
- staudenmeir/eloquent-eager-limit dependency.
- Fine tuned MessageTransformer. Bug fixes on some sentences.
- Renamed ALL methods on the MessengerProvider contract and matching trait to avoid future conflicts with other laravel packages / implementations.
name()togetProviderName()getAvatarColumn()togetProviderAvatarColumn()getLastActiveColumn()togetProviderLastActiveColumn()getAvatarRoute()togetProviderAvatarRoute()getRoute()togetProviderProfileRoute()onlineStatus()togetProviderOnlineStatus()onlineStatusVerbose()togetProviderOnlineStatusVerbose()
- MessageTransformer support class to generate and transform message body.
- Bugfix in JS where failed message image loaded improper not found image.
- Yarn upgrade. Assets recompiled.
- Message transformer methods from MessageResource class.
.svgas a valid default image mime allowed for upload.
- FileService now resets properties after each
upload,destroyanddestroyDirectory.
getName()method removed from FileService.upload()method returns final file name now.
- Support for morph maps on polymorphic relations for providers.
- All instances of
get_class()replaced with$model->getMorphClass().
getProviderId()andgetProviderClass()methods removed from Messenger.
- StoreMessengerIp listener removed. Up to end user to attach listener to heartbeat event should they want to use the IP provided.
instance()method on messenger singleton renamed togetInstance()- General major refactoring.
- bool column
embedsand nullable/text columnextraonmessagestable. - Optional extra payload when sending messages to allow custom json to be stored with the message.
- More extensive model factories.
- New routes for viewing group avatar when joining with an invitation.
- Renamed action class UpdateMessage to EditMessage.
- Ignore call option. When ignoring a private call, it will also end the call.
- Either party in a private call can end the call.
- Message reactions feature. New table
message_reactions. - Events/broadcast for reactions feature.
- bool
editedandreactedcolumns on messages table. - New providers scope using concat() on polymorph keys.
- Custom rule to verify an emoji exist in string.
- Message edits go by bool
editedand notupdated_atcolumn now. - Emoji converter is now an interface/service.
- New emoji picker added to the included UI.
- Emoji converter is now a service/interface.
- Message replies.
- reply_to_id column on the messages table.
- All store message actions accept params as array now instead of individual params.
- Audio message type to upload audio files. ~ Configs for audio files.
- Command to purge archived audio files.
- Routes to store/view/paginate and stream/download audio files.
- Updated the UI to include support for audio files in a thread.
message_documents.downloadtoggle in config removed.
- New configs to set mime types allowed to upload on each file type.
- threads, messages, participants and message_edits tables use precision 6 for timestamps now.
- Allow more mime types on uploads, frontend assets updated with this as well.
- Misc bug fixes along with image service not resizing gif/svg/webp.
- New configs to set upload limit sizes.
- New commands to temporarily shutdown calling system and end all active calls, as well as put the system back online.
- More file moves/renames.
- Set broadcast/video driver on demand.
- helpers.php methods except messenger().
- New Helpers class and support directory. Moved files around.
- Added intermediate modal to confirm joining call once page loads.
- Bugfix on join call skipping generating participant resource on response.
- Broadcast broker resets private/presence each time to method called.
- StoreEditMessage listener.
- Edit message action will store the edit history immediately after update message.
- Put a primary key back onto messenger model and table messengers.
- New Exceptions.
- Exceptions thrown throughout out package.
- Moved some authorization logic done in controllers or model into actions.
- Edit message table to store edit history.
- Route to view edit history.
- Config option to disable both edit message and viewing edit history.
- Edit message feature.
teardown_completeadded to calls table used to avoid duplicate tear downs. Added a short cache lockout upon ending a call to avoid race conditions with automated EndCallIfEmpty job.
- To avoid conflicts with channel names across apps, our channels are now prefixed with
messenger.All impacted test and frontend assets have been updated to reflect this change.
- Test.
- Everything.