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
2d846961
Commit
2d846961
authored
Mar 21, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'type' = 'chatroom' instead of 'chatroom' boolean.
parent
3aefba32
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
14 deletions
+13
-14
src/converse-chatview.js
src/converse-chatview.js
+5
-6
src/converse-controlbox.js
src/converse-controlbox.js
+2
-2
src/converse-muc.js
src/converse-muc.js
+6
-6
No files found.
src/converse-chatview.js
View file @
2d846961
...
@@ -36,10 +36,7 @@
...
@@ -36,10 +36,7 @@
ChatBoxViews
:
{
ChatBoxViews
:
{
onChatBoxAdded
:
function
(
item
)
{
onChatBoxAdded
:
function
(
item
)
{
var
view
=
this
.
get
(
item
.
get
(
'
id
'
));
var
view
=
this
.
get
(
item
.
get
(
'
id
'
));
// FIXME: leaky abstraction from chatroom here, need to
if
(
!
view
)
{
// come up with a nicer solution for this.
// Perhaps change 'chatroom' to more generic non-boolean
if
(
!
view
&&
!
item
.
get
(
'
chatroom
'
))
{
view
=
new
converse
.
ChatBoxView
({
model
:
item
});
view
=
new
converse
.
ChatBoxView
({
model
:
item
});
this
.
add
(
item
.
get
(
'
id
'
),
view
);
this
.
add
(
item
.
get
(
'
id
'
),
view
);
return
view
;
return
view
;
...
@@ -600,7 +597,8 @@
...
@@ -600,7 +597,8 @@
message
=
$textarea
.
val
();
message
=
$textarea
.
val
();
$textarea
.
val
(
''
).
focus
();
$textarea
.
val
(
''
).
focus
();
if
(
message
!==
''
)
{
if
(
message
!==
''
)
{
if
(
this
.
model
.
get
(
'
chatroom
'
))
{
// XXX: leaky abstraction from MUC
if
(
this
.
model
.
get
(
'
type
'
)
===
'
chatroom
'
)
{
this
.
onChatRoomMessageSubmitted
(
message
);
this
.
onChatRoomMessageSubmitted
(
message
);
}
else
{
}
else
{
this
.
onMessageSubmitted
(
message
);
this
.
onMessageSubmitted
(
message
);
...
@@ -608,7 +606,8 @@
...
@@ -608,7 +606,8 @@
converse
.
emit
(
'
messageSend
'
,
message
);
converse
.
emit
(
'
messageSend
'
,
message
);
}
}
this
.
setChatState
(
converse
.
ACTIVE
);
this
.
setChatState
(
converse
.
ACTIVE
);
}
else
if
(
!
this
.
model
.
get
(
'
chatroom
'
))
{
// chat state data is currently only for single user chat
// XXX: leaky abstraction from MUC
}
else
if
(
this
.
model
.
get
(
'
type
'
)
!==
'
chatroom
'
)
{
// chat state data is currently only for single user chat
// Set chat state to composing if keyCode is not a forward-slash
// Set chat state to composing if keyCode is not a forward-slash
// (which would imply an internal command and not a message).
// (which would imply an internal command and not a message).
this
.
setChatState
(
converse
.
COMPOSING
,
ev
.
keyCode
===
KEY
.
FORWARD_SLASH
);
this
.
setChatState
(
converse
.
COMPOSING
,
ev
.
keyCode
===
KEY
.
FORWARD_SLASH
);
...
...
src/converse-controlbox.js
View file @
2d846961
...
@@ -88,9 +88,9 @@
...
@@ -88,9 +88,9 @@
var
view
=
this
.
get
(
item
.
get
(
'
id
'
));
var
view
=
this
.
get
(
item
.
get
(
'
id
'
));
if
(
!
view
&&
item
.
get
(
'
box_id
'
)
===
'
controlbox
'
)
{
if
(
!
view
&&
item
.
get
(
'
box_id
'
)
===
'
controlbox
'
)
{
view
=
new
converse
.
ControlBoxView
({
model
:
item
});
view
=
new
converse
.
ControlBoxView
({
model
:
item
});
this
.
add
(
item
.
get
(
'
id
'
),
view
);
return
this
.
add
(
item
.
get
(
'
id
'
),
view
);
}
else
{
}
else
{
this
.
_super
.
onChatBoxAdded
.
apply
(
this
,
arguments
);
return
this
.
_super
.
onChatBoxAdded
.
apply
(
this
,
arguments
);
}
}
},
},
...
...
src/converse-muc.js
View file @
2d846961
...
@@ -171,7 +171,7 @@
...
@@ -171,7 +171,7 @@
'
jid
'
:
room_jid
,
'
jid
'
:
room_jid
,
'
name
'
:
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
room_jid
)),
'
name
'
:
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
room_jid
)),
'
nick
'
:
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
converse
.
connection
.
jid
)),
'
nick
'
:
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
converse
.
connection
.
jid
)),
'
chatroom
'
:
true
,
'
type
'
:
'
chatroom
'
,
'
box_id
'
:
b64_sha1
(
room_jid
),
'
box_id
'
:
b64_sha1
(
room_jid
),
'
password
'
:
$x
.
attr
(
'
password
'
)
'
password
'
:
$x
.
attr
(
'
password
'
)
});
});
...
@@ -188,11 +188,11 @@
...
@@ -188,11 +188,11 @@
ChatBoxViews
:
{
ChatBoxViews
:
{
onChatBoxAdded
:
function
(
item
)
{
onChatBoxAdded
:
function
(
item
)
{
var
view
=
this
.
get
(
item
.
get
(
'
id
'
));
var
view
=
this
.
get
(
item
.
get
(
'
id
'
));
if
(
!
view
&&
item
.
get
(
'
chatroom
'
)
)
{
if
(
!
view
&&
item
.
get
(
'
type
'
)
===
'
chatroom
'
)
{
view
=
new
converse
.
ChatRoomView
({
'
model
'
:
item
});
view
=
new
converse
.
ChatRoomView
({
'
model
'
:
item
});
this
.
add
(
item
.
get
(
'
id
'
),
view
);
return
this
.
add
(
item
.
get
(
'
id
'
),
view
);
}
else
{
}
else
{
this
.
_super
.
onChatBoxAdded
.
apply
(
this
,
arguments
);
return
this
.
_super
.
onChatBoxAdded
.
apply
(
this
,
arguments
);
}
}
}
}
}
}
...
@@ -1322,7 +1322,7 @@
...
@@ -1322,7 +1322,7 @@
'
jid
'
:
jid
,
'
jid
'
:
jid
,
'
name
'
:
name
||
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
jid
)),
'
name
'
:
name
||
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
jid
)),
'
nick
'
:
nick
,
'
nick
'
:
nick
,
'
chatroom
'
:
true
,
'
type
'
:
'
chatroom
'
,
'
box_id
'
:
b64_sha1
(
jid
)
'
box_id
'
:
b64_sha1
(
jid
)
});
});
},
},
...
@@ -1358,7 +1358,7 @@
...
@@ -1358,7 +1358,7 @@
'
jid
'
:
jid
,
'
jid
'
:
jid
,
'
name
'
:
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
jid
)),
'
name
'
:
Strophe
.
unescapeNode
(
Strophe
.
getNodeFromJid
(
jid
)),
'
nick
'
:
nick
,
'
nick
'
:
nick
,
'
chatroom
'
:
true
,
'
type
'
:
'
chatroom
'
,
'
box_id
'
:
b64_sha1
(
jid
)
'
box_id
'
:
b64_sha1
(
jid
)
});
});
}
}
...
...
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