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
82659e87
Commit
82659e87
authored
Sep 05, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add extra chat room commands: /nick, /mute and /voice.
Also document the available chat room commands.
parent
78ac525e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
24 deletions
+76
-24
converse.js
converse.js
+28
-19
css/converse.css
css/converse.css
+3
-0
docs/CHANGES.rst
docs/CHANGES.rst
+2
-0
docs/source/index.rst
docs/source/index.rst
+39
-5
less/converse.less
less/converse.less
+4
-0
No files found.
converse.js
View file @
82659e87
...
...
@@ -2021,38 +2021,47 @@
var
match
=
body
.
replace
(
/^
\s
*/
,
""
).
match
(
/^
\/(
.*
?)(?:
(
.*
))?
$/
)
||
[
false
],
$chat_content
;
switch
(
match
[
1
])
{
case
'
msg
'
:
// TODO: Private messages
case
'
ban
'
:
converse
.
connection
.
muc
.
ban
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
break
;
case
'
clear
'
:
this
.
clearChatRoomMessages
();
break
;
case
'
topic
'
:
converse
.
connection
.
muc
.
setTopic
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
case
'
deop
'
:
converse
.
connection
.
muc
.
deop
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
break
;
case
'
help
'
:
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
);
msgs
=
[
'
<strong>/ban</strong>:
'
+
__
(
'
Ban user from room
'
),
'
<strong>/clear</strong>:
'
+
__
(
'
Remove messages
'
),
'
<strong>/help</strong>:
'
+
__
(
'
Show this menu
'
),
'
<strong>/kick</strong>:
'
+
__
(
'
Kick user from room
'
),
'
<strong>/me</strong>:
'
+
__
(
'
Write in 3rd person
'
),
'
<strong>/mute</strong>:
'
+
__
(
"
Remove user's ability to post messages
"
),
'
<strong>/nick</strong>:
'
+
__
(
'
Change your nickname
'
),
'
<strong>/topic</strong>:
'
+
__
(
'
Set room topic
'
),
'
<strong>/voice</strong>:
'
+
__
(
'
Allow muted user to post messages
'
)
];
this
.
showHelpMessages
(
msgs
);
break
;
case
'
kick
'
:
converse
.
connection
.
muc
.
kick
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
break
;
case
'
ban
'
:
converse
.
connection
.
muc
.
ban
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
case
'
mute
'
:
converse
.
connection
.
muc
.
mute
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
break
;
case
'
nick
'
:
converse
.
connection
.
muc
.
changeNick
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
break
;
case
'
op
'
:
converse
.
connection
.
muc
.
op
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
break
;
case
'
deop
'
:
converse
.
connection
.
muc
.
deop
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
case
'
topic
'
:
converse
.
connection
.
muc
.
setTopic
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
break
;
case
'
help
'
:
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
);
msgs
=
[
'
<strong>/help</strong>:
'
+
__
(
'
Show this menu
'
)
+
''
,
'
<strong>/me</strong>:
'
+
__
(
'
Write in the third person
'
)
+
''
,
'
<strong>/topic</strong>:
'
+
__
(
'
Set chatroom topic
'
)
+
''
,
'
<strong>/kick</strong>:
'
+
__
(
'
Kick user from chatroom
'
)
+
''
,
'
<strong>/ban</strong>:
'
+
__
(
'
Ban user from chatroom
'
)
+
''
,
'
<strong>/clear</strong>:
'
+
__
(
'
Remove messages
'
)
+
''
];
this
.
showHelpMessages
(
msgs
);
case
'
voice
'
:
converse
.
connection
.
muc
.
voice
(
this
.
model
.
get
(
'
jid
'
),
match
[
2
]);
break
;
default
:
this
.
last_msgid
=
converse
.
connection
.
muc
.
groupchat
(
this
.
model
.
get
(
'
jid
'
),
body
);
...
...
css/converse.css
View file @
82659e87
...
...
@@ -393,6 +393,9 @@
font
:
inherit
;
vertical-align
:
baseline
;
}
#conversejs
strong
{
font-weight
:
700
;
}
#conversejs
,
#conversejs
input
,
#conversejs
textarea
{
...
...
docs/CHANGES.rst
View file @
82659e87
...
...
@@ -4,6 +4,8 @@ Changelog
0.8.1 (Unreleased)
------------------
* Allow changing of nickname in a chat room via /nick command. [jcbrand]
* Allow a chat room user to be muted or unmuted with the /mute and /voice commands. [jcbrand]
* Add a chat room toolbar button for toggling the list of participants. [jcbrand]
* Converse.js now responds to XEP-0030: Service Discovery requests. [jcbrand]
* Bugfix. Roster groups all appear offline after page reload (with prebind).
...
...
docs/source/index.rst
View file @
82659e87
...
...
@@ -340,6 +340,40 @@ Languages increase the size of the Converse.js significantly.
If you only need one, or a subset of the available languages, it's better to
make a custom build which includes only those languages that you need.
Chat Rooms
==========
Commands
--------
Here are the different commands that may be used in a chat room:
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| Event Type | When is it triggered? | Example (substitue $nickname with an actual user's nickname) |
+============+==============================================================================================+===============================================================+
| **ban** | Ban a user from the chat room. They will not be able to join again. | /ban $nickname |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **clear** | Clear the messages shown in the chat room. | /clear |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **deop** | Make a moderator a normal participant. | /deop $nickname |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **help** | Show the list of available commands. | /help |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **kick** | Kick a user out of a room. They will be able to join again. | /kick $nickname |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **me** | Speak in the 3rd person. | /me $message |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **mute** | Remove a user's ability to post messages to the room. They will still be able to observe. | /mute $nickname |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **nick** | Change your nickname. | /nick $nickname |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **op** | Make a normal participant a moderator. | /op $nickname |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **topic** | Set the topic of the chat room. | /topic ${topic text} |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| **voice** | Allow a muted user to post messages to the room. | /voice $nickname |
+------------+----------------------------------------------------------------------------------------------+---------------------------------------------------------------+
===========
Development
===========
...
...
@@ -916,7 +950,7 @@ Both message_carbons and `forward_messages`_ try to solve the same problem
in two different ways.
Message carbons is the XEP (Jabber protocol extension) specifically drafted to
solve this problem, while `forwarded_messages`_ uses
solve this problem, while `forwarded_messages`_ uses
`stanza forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
expose_rid_and_sid
...
...
@@ -1049,7 +1083,7 @@ Default: ``session``
Valid options: ``session``, ``local``.
This option determines the type of `storage <https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage>`_
This option determines the type of `storage <https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage>`_
(``localStorage`` or ``sessionStorage``) used by converse.js to cache user data.
Originally converse.js used only localStorage, however sessionStorage is from a
...
...
@@ -1104,7 +1138,7 @@ Default:
Allows you to show or hide buttons on the chat boxes' toolbars.
* *call*:
* *call*:
Provides a button with a picture of a telephone on it.
When the call button is pressed, it will emit an event that can be used by a third-party library to initiate a call.::
...
...
@@ -1113,9 +1147,9 @@ Allows you to show or hide buttons on the chat boxes' toolbars.
console.log('Bare buddy JID is', data.model.get('jid'));
// ... Third-party library code ...
});
* *clear*:
* *clear*:
Provides a button for clearing messages from a chat box.
* *emoticons*:
* *emoticons*:
Enables rendering of emoticons and provides a toolbar button for choosing them.
* toggle_participants:
Shows a button for toggling (i.e. showing/hiding) the list of participants in a chat room.
...
...
less/converse.less
View file @
82659e87
...
...
@@ -407,6 +407,10 @@
vertical-align: baseline;
}
#conversejs strong {
font-weight: 700;
}
#conversejs,
#conversejs input,
#conversejs textarea {
...
...
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