You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means forking the project and making changes that almost negate the ability to use the package unless you are 100% OK with the existing message types.
By making the message type relatable to a plugin system, we could make extending the message system a lot simpler while allowing the core to improve without having to fork it. Our internal chat system currently does this and it works well. The solution might look something like this:
Creation of a Message type resolver
Move 'type' from const into a repository.
Exchange use of dedicated endpoints (images/documents) for a generic filter/search controller
Migrate static functions in the Message Transphormer to individual classes
Register classes with Message type resolve
Make relevant updates to permission system
These changes would make creation of new types of messages as easy as:
Creating a new class
Implementing one or more methods on the class
Registering the class with the type resolver
Example
class AutomatedReply implements MessageTypeInterface
{
publicfunctionmake(Thread$thread, Provider$provider)
{
return ['subject' => 'This is an automated reply.'];
}
// public function transform(string $body) - if you want to transform the body itself// public function transformResource() - if you want to transform the resource// public search() - modify search queries?
}
and then in a provider somewhere:
MessageTypeProvider::registerType('automated_reply', AutomatedReply::class);
// Register again because maybe you want several types of automated replies.
MessageTypeProvider::registerType('custom_one', AutomatedReply::class);
While the initial work would be somewhat involved, I think the long term benefits would be huge.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In order to create new message types, the following files have to be modified:
This means forking the project and making changes that almost negate the ability to use the package unless you are 100% OK with the existing message types.
By making the message type relatable to a plugin system, we could make extending the message system a lot simpler while allowing the core to improve without having to fork it. Our internal chat system currently does this and it works well. The solution might look something like this:
constinto a repository.These changes would make creation of new types of messages as easy as:
Example
and then in a provider somewhere:
While the initial work would be somewhat involved, I think the long term benefits would be huge.
All reactions