Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
bf639ff5
Commit
bf639ff5
authored
8 years ago
by
Rodrigo Nascimento
Browse files
Options
Downloads
Patches
Plain Diff
Improve report abuse to pass the message id instead of message object
Closes #6038
parent
790c6193
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/rocketchat-ui/views/app/mobileMessageMenu.js
+1
-1
1 addition, 1 deletion
packages/rocketchat-ui/views/app/mobileMessageMenu.js
server/methods/reportMessage.js
+9
-2
9 additions, 2 deletions
server/methods/reportMessage.js
with
10 additions
and
3 deletions
packages/rocketchat-ui/views/app/mobileMessageMenu.js
+
1
−
1
View file @
bf639ff5
...
...
@@ -58,7 +58,7 @@ const mobileMessageMenu = {
return
false
;
}
Meteor
.
call
(
'
reportMessage
'
,
message
,
inputValue
);
Meteor
.
call
(
'
reportMessage
'
,
message
.
_id
,
inputValue
);
swal
({
title
:
TAPi18n
.
__
(
'
Report_sent
'
),
...
...
This diff is collapsed.
Click to expand it.
server/methods/reportMessage.js
+
9
−
2
View file @
bf639ff5
Meteor
.
methods
({
reportMessage
(
message
,
description
)
{
check
(
message
,
Object
);
reportMessage
(
message
Id
,
description
)
{
check
(
message
Id
,
String
);
check
(
description
,
String
);
if
(
!
Meteor
.
userId
())
{
...
...
@@ -15,6 +15,13 @@ Meteor.methods({
});
}
const
message
=
RocketChat
.
models
.
Messages
.
findOneById
(
messageId
);
if
(
!
message
)
{
throw
new
Meteor
.
Error
(
'
error-invalid-message_id
'
,
'
Invalid message id
'
,
{
method
:
'
reportMessage
'
});
}
return
RocketChat
.
models
.
Reports
.
createWithMessageDescriptionAndUserId
(
message
,
description
,
Meteor
.
userId
());
}
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment