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
e0192b7f
Commit
e0192b7f
authored
7 years ago
by
Guilherme Gazzo
Browse files
Options
Downloads
Patches
Plain Diff
fix review
parent
178fca66
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-lib/server/methods/deleteMessage.js
+7
-7
7 additions, 7 deletions
packages/rocketchat-lib/server/methods/deleteMessage.js
packages/rocketchat-lib/server/methods/robotMethods.js
+1
-1
1 addition, 1 deletion
packages/rocketchat-lib/server/methods/robotMethods.js
with
8 additions
and
8 deletions
packages/rocketchat-lib/server/methods/deleteMessage.js
+
7
−
7
View file @
e0192b7f
...
@@ -32,16 +32,16 @@ Meteor.methods({
...
@@ -32,16 +32,16 @@ Meteor.methods({
action
:
'
Delete_message
'
action
:
'
Delete_message
'
});
});
}
}
let
msgTs
;
let
currentTsDiff
;
const
blockDeleteInMinutes
=
RocketChat
.
settings
.
get
(
'
Message_AllowDeleting_BlockDeleteInMinutes
'
);
const
blockDeleteInMinutes
=
RocketChat
.
settings
.
get
(
'
Message_AllowDeleting_BlockDeleteInMinutes
'
);
if
(
(
blockDeleteInMinutes
!=
null
)
&&
blockDeleteInMinutes
!==
0
)
{
if
(
blockDeleteInMinutes
!=
null
&&
blockDeleteInMinutes
!==
0
)
{
if
(
originalMessage
.
ts
!
=
null
)
{
if
(
originalMessage
.
ts
=
=
null
)
{
msgTs
=
moment
(
originalMessage
.
ts
)
;
return
;
}
}
if
(
msgTs
!=
null
)
{
const
msgTs
=
moment
(
originalMessage
.
ts
);
currentTsDiff
=
moment
().
diff
(
msgTs
,
'
minutes
'
);
if
(
msgTs
==
null
)
{
return
;
}
}
const
currentTsDiff
=
moment
().
diff
(
msgTs
,
'
minutes
'
);
if
(
currentTsDiff
>
blockDeleteInMinutes
)
{
if
(
currentTsDiff
>
blockDeleteInMinutes
)
{
throw
new
Meteor
.
Error
(
'
error-message-deleting-blocked
'
,
'
Message deleting is blocked
'
,
{
throw
new
Meteor
.
Error
(
'
error-message-deleting-blocked
'
,
'
Message deleting is blocked
'
,
{
method
:
'
deleteMessage
'
method
:
'
deleteMessage
'
...
...
This diff is collapsed.
Click to expand it.
packages/rocketchat-lib/server/methods/robotMethods.js
+
1
−
1
View file @
e0192b7f
...
@@ -20,6 +20,6 @@ Meteor.methods({
...
@@ -20,6 +20,6 @@ Meteor.methods({
});
});
}
}
const
cursor
=
RocketChat
.
models
[
model
][
method
].
apply
(
RocketChat
.
models
[
model
],
args
);
const
cursor
=
RocketChat
.
models
[
model
][
method
].
apply
(
RocketChat
.
models
[
model
],
args
);
return
cursor
&&
cursor
.
fetch
&&
cursor
.
fetch
();
return
cursor
&&
cursor
.
fetch
?
cursor
.
fetch
()
:
cursor
;
}
}
});
});
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