Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
e4010185
Commit
e4010185
authored
Nov 22, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new config option allow_message_retractions
parent
2eff75b3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
16 deletions
+37
-16
CHANGES.md
CHANGES.md
+3
-2
docs/source/configuration.rst
docs/source/configuration.rst
+26
-12
src/converse-message-view.js
src/converse-message-view.js
+8
-2
No files found.
CHANGES.md
View file @
e4010185
...
...
@@ -10,8 +10,9 @@
To add custom emojis, edit the
`emojis.json`
file.
-
Refactor some presence and status handling code from
`converse-core`
into
`@converse/headless/converse-status`
.
-
New API
[
\_converse.api.headlines
](
https://conversejs.org/docs/html/api/-_converse.api.headlines.html#.get
)
-
New config option
[
muc_mention_autocomplete_filter
](
https://conversejs.org/docs/html/configuration.html#muc_mention_autocomplete_filter
)
-
New config option
[
muc_mention_autocomplete_show_avatar
](
https://conversejs.org/docs/html/configuration.html#muc_mention_autocomplete_show_avatar
)
-
New config option
[
muc-mention-autocomplete-filter
](
https://conversejs.org/docs/html/configuration.html#muc-mention-autocomplete-filter
)
-
New config option
[
muc-mention-autocomplete-show-avatar
](
https://conversejs.org/docs/html/configuration.html#muc-mention-autocomplete-show-avatar
)
-
New config option
[
allow_message_retraction
](
https://conversejs.org/docs/html/configuration.html#allow-message-retraction
)
-
#129: Add support for XEP-0156: Disovering Alternative XMPP Connection Methods. Only XML is supported for now.
-
#1105: Preliminary support for storing persistent data in IndexedDB instead of localStorage
...
...
docs/source/configuration.rst
View file @
e4010185
...
...
@@ -149,6 +149,32 @@ allow_logout
Determines whether the user is allowed to log out. If set to ``false``, there will be no logout button.
.. _`allow_message_corrections`:
allow_message_corrections
-------------------------
* Default: ``'all'``
* Possible values: ``'all'``, ``'last'``
Configures the last message correction (LMC) feature of Converse. By default you can edit all of your own
messages. Setting this to ``'last'`` will limit this feature to the message sent most recently as suggested by
`XEP-0308: Last Message Correction <https://xmpp.org/extensions/xep-0308.html>`_.
Setting it to anything else (including ``false``) will disable the ability to correct sent messages.
allow_message_retraction
------------------------
* Default: ``'all'``
* Possible values: ``'all'``, ``'own'``, ``'moderator'``
Determines who is allowed to retract messages. If set to ``'all'``, then normal
users may retract their own messages and ``'moderators'`` may retract the messages of
other users.
allow_muc
---------
...
...
@@ -858,18 +884,6 @@ keepalive
Determines whether Converse will attempt to keep you logged in across page loads.
.. _`allow_message_corrections`:
allow_message_corrections
-------------------------
* Default: ``'all'``
Configures the last message correction (LMC) feature of Converse. By default you can edit all of your own
messages. Setting this to ``'last'`` will limit this feature to the message sent most recently as suggested by
`XEP-0308: Last Message Correction <https://xmpp.org/extensions/xep-0308.html>`_.
Setting it to anything else (including ``false``) will disable the ability to correct sent messages.
.. _`locales`:
locales
...
...
src/converse-message-view.js
View file @
e4010185
...
...
@@ -68,7 +68,8 @@ converse.plugins.add('converse-message-view', {
_converse
.
api
.
settings
.
update
({
'
show_images_inline
'
:
true
'
show_images_inline
'
:
true
,
'
allow_message_retraction
'
:
'
all
'
});
_converse
.
MessageVersionsModal
=
_converse
.
BootstrapModal
.
extend
({
...
...
@@ -245,7 +246,12 @@ converse.plugins.add('converse-message-view', {
const
is_groupchat
=
this
.
model
.
get
(
'
type
'
)
===
'
groupchat
'
;
const
is_own_message
=
this
.
model
.
get
(
'
sender
'
)
===
'
me
'
;
const
chatbox
=
this
.
model
.
collection
.
chatbox
;
const
retractable
=
!
is_retracted
&&
(
is_groupchat
?
await
chatbox
.
canRetractMessages
()
:
is_own_message
);
const
may_retract_own_message
=
is_own_message
&&
[
'
all
'
,
'
own
'
].
includes
(
_converse
.
allow_message_retraction
);
const
may_moderate_message
=
is_groupchat
&&
[
'
all
'
,
'
moderator
'
].
includes
(
_converse
.
allow_message_retraction
)
&&
await
chatbox
.
canRetractMessages
();
const
retractable
=
!
is_retracted
&&
(
may_moderate_message
||
may_retract_own_message
);
const
msg
=
u
.
stringToElement
(
tpl_message
(
Object
.
assign
(
this
.
model
.
toJSON
(),
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment