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
9ee5550c
Commit
9ee5550c
authored
Jun 15, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inverse: bugfix, when reloading, hidden auto-joined room was displayed
parent
7e62546d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
32 deletions
+46
-32
src/converse-muc.js
src/converse-muc.js
+33
-31
src/converse-singleton.js
src/converse-singleton.js
+13
-1
No files found.
src/converse-muc.js
View file @
9ee5550c
...
...
@@ -345,41 +345,39 @@
});
_converse
.
openChatRoom
=
function
(
settings
)
{
/*
Creates a new
chat room, making sure that certain attributes
/*
Opens a
chat room, making sure that certain attributes
* are correct, for example that the "type" is set to
* "chatroom".
*/
settings
=
_
.
extend
(
_
.
zipObject
(
ROOM_FEATURES
,
_
.
map
(
ROOM_FEATURES
,
_
.
stubFalse
)),
settings
);
return
_converse
.
chatboxviews
.
showChat
(
_
.
extend
({
'
affiliation
'
:
null
,
'
connection_status
'
:
ROOMSTATUS
.
DISCONNECTED
,
'
description
'
:
''
,
'
features_fetched
'
:
false
,
'
roomconfig
'
:
{},
'
type
'
:
CHATROOMS_TYPE
,
},
settings
)
);
settings
=
_
.
assign
({
'
type
'
:
CHATROOMS_TYPE
},
settings
);
return
_converse
.
chatboxviews
.
showChat
(
settings
);
};
_converse
.
ChatRoom
=
_converse
.
ChatBox
.
extend
({
defaults
:
function
()
{
return
_
.
extend
(
_
.
clone
(
_converse
.
ChatBox
.
prototype
.
defaults
),
{
'
type
'
:
CHATROOMS_TYPE
,
// For group chats, we distinguish between generally unread
// messages and those ones that specifically mention the
// user.
//
// To keep things simple, we reuse `num_unread` from
// _converse.ChatBox to indicate unread messages which
// mention the user and `num_unread_general` to indicate
// generally unread messages (which *includes* mentions!).
'
num_unread_general
'
:
0
});
return
_
.
assign
(
_
.
clone
(
_converse
.
ChatBox
.
prototype
.
defaults
),
_
.
zipObject
(
ROOM_FEATURES
,
_
.
map
(
ROOM_FEATURES
,
_
.
stubFalse
)),
{
// For group chats, we distinguish between generally unread
// messages and those ones that specifically mention the
// user.
//
// To keep things simple, we reuse `num_unread` from
// _converse.ChatBox to indicate unread messages which
// mention the user and `num_unread_general` to indicate
// generally unread messages (which *includes* mentions!).
'
num_unread_general
'
:
0
,
'
affiliation
'
:
null
,
'
connection_status
'
:
ROOMSTATUS
.
DISCONNECTED
,
'
description
'
:
''
,
'
features_fetched
'
:
false
,
'
roomconfig
'
:
{},
'
type
'
:
CHATROOMS_TYPE
,
}
);
},
isUserMentioned
:
function
(
message
)
{
...
...
@@ -2574,8 +2572,7 @@
}
},
openChatRoom
:
function
(
ev
)
{
ev
.
preventDefault
();
parseRoomDataFromEvent
:
function
(
ev
)
{
var
name
,
$name
,
server
,
$server
,
jid
;
if
(
ev
.
type
===
'
click
'
)
{
name
=
$
(
ev
.
target
).
text
();
...
...
@@ -2597,13 +2594,18 @@
return
;
}
}
_converse
.
openChatRoom
(
{
return
{
'
id
'
:
jid
,
'
jid
'
:
jid
,
'
name
'
:
name
||
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
jid
)),
'
type
'
:
CHATROOMS_TYPE
,
'
box_id
'
:
b64_sha1
(
jid
)
});
}
},
openChatRoom
:
function
(
ev
)
{
ev
.
preventDefault
();
_converse
.
openChatRoom
(
this
.
parseRoomDataFromEvent
(
ev
));
},
setDomain
:
function
(
ev
)
{
...
...
src/converse-singleton.js
View file @
9ee5550c
...
...
@@ -54,6 +54,17 @@
return
this
.
__super__
.
createChatBox
.
call
(
this
,
jid
,
attrs
);
}
},
RoomsPanel
:
{
parseRoomDataFromEvent
:
function
(
ev
)
{
/* We set hidden to false for rooms opened manually by the
* user. They should always be shown.
*/
var
result
=
this
.
__super__
.
parseRoomDataFromEvent
.
apply
(
this
,
arguments
);
result
.
hidden
=
false
;
return
result
;
}
},
ChatBoxViews
:
{
showChat
:
function
(
attrs
,
force
)
{
...
...
@@ -63,7 +74,8 @@
*/
var
_converse
=
this
.
__super__
.
_converse
;
var
chatbox
=
this
.
getChatBox
(
attrs
,
true
);
if
((
force
||
!
attrs
.
hidden
)
&&
_converse
.
connection
.
authenticated
)
{
var
hidden
=
_
.
isUndefined
(
attrs
.
hidden
)
?
chatbox
.
get
(
'
hidden
'
)
:
attrs
.
hidden
;
if
((
force
||
!
hidden
)
&&
_converse
.
connection
.
authenticated
)
{
_
.
each
(
_converse
.
chatboxviews
.
xget
(
chatbox
.
get
(
'
id
'
)),
hideChat
);
chatbox
.
save
({
'
hidden
'
:
false
});
}
...
...
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