Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
solid-xmpp-chat
Manage
Activity
Members
Labels
Plan
Issues
45
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Components
solid-xmpp-chat
Commits
50a6265b
Commit
50a6265b
authored
3 years ago
by
ubermanu
Browse files
Options
Downloads
Patches
Plain Diff
minor: allow users to retract file uploads
parent
f70f8a9e
No related branches found
No related tags found
2 merge requests
!136
Reactions, Retract upload...
,
!135
Allow upload retraction
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/sib-retract-file-upload.js
+34
-0
34 additions, 0 deletions
src/plugins/sib-retract-file-upload.js
src/solid-xmpp-chat.js
+2
-0
2 additions, 0 deletions
src/solid-xmpp-chat.js
with
36 additions
and
0 deletions
src/plugins/sib-retract-file-upload.js
0 → 100644
+
34
−
0
View file @
50a6265b
/**
* Allow the user to retract a file upload.
*/
converse
.
plugins
.
add
(
'
sib-retract-file-upload
'
,
{
initialize
()
{
const
_converse
=
this
.
_converse
;
const
{
api
,
Message
}
=
_converse
;
api
.
settings
.
extend
({
'
allow_upload_retraction
'
:
'
own
'
,
});
const
MessageMixin
=
{
/**
* The message can be retracted if the above option is correctly set.
* Overrides the 'allow_message_retraction' setting if disabled.
*
* @private
* @method _converse.Messages#mayBeRetracted
* @returns { Boolean }
*/
mayBeRetracted
()
{
return
_mayBeRetracted
.
call
(
this
)
||
(
this
.
get
(
'
sender
'
)
===
'
me
'
&&
this
.
get
(
'
oob_url
'
)
&&
[
'
all
'
,
'
own
'
].
includes
(
api
.
settings
.
get
(
'
allow_upload_retraction
'
))
);
},
};
const
_mayBeRetracted
=
Message
.
prototype
.
mayBeRetracted
;
Object
.
assign
(
Message
.
prototype
,
MessageMixin
);
},
});
This diff is collapsed.
Click to expand it.
src/solid-xmpp-chat.js
+
2
−
0
View file @
50a6265b
...
@@ -15,6 +15,7 @@ import './plugins/sib-history-improved.js';
...
@@ -15,6 +15,7 @@ import './plugins/sib-history-improved.js';
import
'
./plugins/sib-mention-mobile.js
'
;
import
'
./plugins/sib-mention-mobile.js
'
;
import
'
./plugins/sib-remove-notifications.js
'
;
import
'
./plugins/sib-remove-notifications.js
'
;
import
'
./plugins/sib-reply-to-message.js
'
;
import
'
./plugins/sib-reply-to-message.js
'
;
import
'
./plugins/sib-retract-file-upload.js
'
;
import
'
./plugins/sib-scroll-down-on-focus.js
'
;
import
'
./plugins/sib-scroll-down-on-focus.js
'
;
import
'
./plugins/sib-subscribe-to-rai.js
'
;
import
'
./plugins/sib-subscribe-to-rai.js
'
;
...
@@ -240,6 +241,7 @@ export const SolidXMPPChat = {
...
@@ -240,6 +241,7 @@ export const SolidXMPPChat = {
'
sib-mention-mobile
'
,
'
sib-mention-mobile
'
,
'
sib-remove-notifications
'
,
'
sib-remove-notifications
'
,
'
sib-reply-to-message
'
,
'
sib-reply-to-message
'
,
'
sib-retract-file-upload
'
,
'
sib-scroll-down-on-focus
'
,
'
sib-scroll-down-on-focus
'
,
'
sib-subscribe-to-rai
'
,
'
sib-subscribe-to-rai
'
,
],
],
...
...
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