Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you plan to use the library? #2

Closed
tgalopin opened this issue Sep 22, 2015 · 8 comments
Closed

How do you plan to use the library? #2

tgalopin opened this issue Sep 22, 2015 · 8 comments

Comments

@tgalopin
Copy link
Contributor

Hello everyone,

I know most of the use cases of this library will be quite classical: conversation between users. However, some of you may have ideas of what they need that we didn't think of.

Please don't hesitate to propose ideas about this library, about how you would like it to work.

@dbu
Copy link

dbu commented Sep 23, 2015 via email

@tgalopin
Copy link
Contributor Author

I completely agree, we have to keep the library clear about what it does: simple messaging between users.

On the other hand, I reviewed the issues of the bundle and some ideas were interesting while staying in the scope of the library. For instance, the tagging system is a generic and simple way to provide several features (directories, search, conversations status, etc.) and it does fit in the library.

@ionafan2
Copy link
Contributor

Hi @tgalopin just don't forget this statement "...simple messaging between users." after 1k commits ;)
And about other hand - provide file attachment ability in core objects (not full functionality implementation, just possibility to implement it in your own project if you will need it).

@ionafan2
Copy link
Contributor

One more thing I think we should keep in mind: often the SocialNetwork (or Friends) functionality is the reason when the project need the messaging system. So there have to be smart validation layer where developers can put theirs validators such as "isFriend, "isBlocked" etc.

@stof
Copy link
Member

stof commented Sep 24, 2015

@ionafan2 I don't think we need anything special about the validation. People would just register additional constraint for the Symfony validator for the classes (assuming we rely on the Symfony validator). this way, they can add whatever validation rule they want without any change in the library.

@tgalopin regarding tagging, the question is whether this needs to be in the library, or whether the library should just have enough extension points to allow having it built on top of it. In some cases, it is more maintainable to provide an extension point than to build the feature directly (and the extension point can be used to build several features generally)

@ionafan2
Copy link
Contributor

@stof yes, you are right. I'm just notice you that the way when adding new behavior is better than extending or changing existing in example on validations, it can be filters or something else

@tgalopin
Copy link
Contributor Author

For the validation I think @stof is right, adding validation rules is just adding custom methods in the models child classes. We don't want to take care of validation in the library.

I'm not totally sure right now if the tagging system should be in the core library or not. A dilemma I have is how to deal with read/not read conversations status. As discussed in FriendsOfSymfony/FOSMessageBundle#112, I think we should store this state in the entity linking a conversation and a user (ConversationPerson) and not on the messages (like in the bundle). I think tagging could be a way to store this status.

On the other hand, we probably want more precision than just a tag, like what is the last message seen (or better, what is the last visit date, to avoid a link to a message). Storing the last visit date let the developer redirect the user to the right page in the conversation if the conversation is paginated for instance.

In the end, I think the best would be to have in the ConversationPerson object a field $lastSeenDate, the repository could have a method to retrieve the last message seen by a given person in a given conversation and the tagging system could be externalized (something optionnal) as @stof proposed. I'm thinking of something like:

$conversation = $repository->getConversation($id);
$lastMessageSeen =  $repository->getLastMessageSeen($conversation, $person);

// We can find the right page to redirect the user to if we paginate conversations

What do you think of this?

@tgalopin
Copy link
Contributor Author

I started an issue for the missions of the library to summarize the different discussions we had in the different topics: #5.

If you could give your input, that would be great!

ericjank added a commit to kilofox/FOSMessage that referenced this issue May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants