WIP: Reaction frontend#2387
Conversation
This commit adds the following.
1. A reaction model that consists of a user, a message and an emoji
2. A reaction event that looks like:
{
'type': 'reaction',
'message_id': 3,
'emoji_name': 'doge',
'user': {
'user_id': 1,
'email': 'hamlet@zulip.com',
'full_name': 'King Hamlet'
}
}
3. A new API endpoint, /reactions, that accepts POST requests to add a
reaction to a message
4. A migration to add the new model to the database
5. Tests that check that
(a) Invalid requests cannot be made
(b) The reaction event body contains all the info
(c) The reaction event is sent to the appropriate users
|
Automated message from Dropbox CLA bot @kracekumar, thanks for the pull request! It looks like you haven't yet signed the Dropbox CLA. Please sign it here. |
|
@kracekumar I merged the initial emoji backend commit after fixing some things; you'll want to rebase, dropping the original backend commit from @arpith's branch. Let me know if you need any help. |
| 'full_name': user_profile.full_name} | ||
|
|
||
| event = {'type': 'reaction', | ||
| 'action': 'add', |
There was a problem hiding this comment.
This got added in master as 'op': 'add'; you should switch your code to use that when you rebase.
|
I took a quick look at your code for doing the fetching @kracekumar, and it looks like you've done a pretty reasonable job of achieving the main goal (not doing database queries in loops). You'll likely need to update several backend tests ( |
|
@timabbott Today I will rebase to the latest master. Does it make sense to send |
|
Either a separate PR or a separate commit at the start of the branch; either way the goal will be to get that commit into shape and merge it next. |
|
@kracekumar you might want to close this PR since we pulled in all the logic required in my branch |
|
Automated message from Dropbox CLA bot @kracekumar, thanks for signing the CLA! |
|
@stanzheng You're correct. |
This is tracking PR for #541. This is forked from #2245.