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
fe6cb93a
Commit
fe6cb93a
authored
Feb 17, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MUC: don't send out chat hints before join or after leave
parent
f83043e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
src/converse-muc.js
src/converse-muc.js
+27
-4
No files found.
src/converse-muc.js
View file @
fe6cb93a
...
...
@@ -344,6 +344,7 @@
this
.
model
.
messages
.
on
(
'
add
'
,
this
.
onMessageAdded
,
this
);
this
.
model
.
on
(
'
show
'
,
this
.
show
,
this
);
this
.
model
.
on
(
'
destroy
'
,
this
.
hide
,
this
);
this
.
model
.
on
(
'
change:connection_status
'
,
this
.
afterConnected
,
this
);
this
.
model
.
on
(
'
change:chat_state
'
,
this
.
sendChatState
,
this
);
this
.
model
.
on
(
'
change:affiliation
'
,
this
.
renderHeading
,
this
);
this
.
model
.
on
(
'
change:name
'
,
this
.
renderHeading
,
this
);
...
...
@@ -397,8 +398,7 @@
},
generateHeadingHTML
:
function
()
{
/* Pure function which returns the heading HTML to be
* rendered.
/* Returns the heading HTML to be rendered.
*/
return
_converse
.
templates
.
chatroom_head
(
_
.
extend
(
this
.
model
.
toJSON
(),
{
...
...
@@ -408,8 +408,7 @@
},
renderHeading
:
function
()
{
/* Render the heading UI of the chat room.
*/
/* Render the heading UI of the chat room. */
this
.
el
.
querySelector
(
'
.chat-head-chatroom
'
).
innerHTML
=
this
.
generateHeadingHTML
();
},
...
...
@@ -433,6 +432,27 @@
return
this
;
},
afterShown
:
function
()
{
/* Override from converse-chatview, specifically to avoid
* the 'active' chat state from being sent out prematurely.
*
* This is instead done in `afterConnected` below.
*/
if
(
_converse
.
connection
.
connected
)
{
// Without a connection, we haven't yet initialized
// localstorage
this
.
model
.
save
();
}
},
afterConnected
:
function
()
{
if
(
this
.
model
.
get
(
'
connection_status
'
)
===
Strophe
.
Status
.
CONNECTED
)
{
this
.
setChatState
(
_converse
.
ACTIVE
);
this
.
scrollDown
();
this
.
focus
();
}
},
getExtraMessageClasses
:
function
(
attrs
)
{
var
extra_classes
=
_converse
.
ChatBoxView
.
prototype
.
getExtraMessageClasses
.
apply
(
this
,
arguments
);
...
...
@@ -790,6 +810,9 @@
* as taken from the 'chat_state' attribute of the chat box.
* See XEP-0085 Chat State Notifications.
*/
if
(
this
.
model
.
get
(
'
connection_status
'
)
!==
Strophe
.
Status
.
CONNECTED
)
{
return
;
}
var
chat_state
=
this
.
model
.
get
(
'
chat_state
'
);
if
(
chat_state
===
_converse
.
GONE
)
{
// <gone/> is not applicable within MUC context
...
...
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