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
495c6060
Commit
495c6060
authored
Feb 14, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow non-roster contacts to be invited to a chatroom.
parent
7b65155d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
docs/CHANGES.md
docs/CHANGES.md
+1
-0
src/converse-muc.js
src/converse-muc.js
+25
-10
No files found.
docs/CHANGES.md
View file @
495c6060
...
...
@@ -13,6 +13,7 @@
-
New configuration setting:
[
show_chatstate_notifications
](
https://conversejs.org/docs/html/configuration.html#show-chatstate-notifications
)
[jcbrand]
-
Allow JIDs not on the roster to be invited to a chatroom. [jcbrand]
-
#770 Allow setting contact attrs on chats.open [Ape]
## 2.0.6 (2017-02-13)
...
...
src/converse-muc.js
View file @
495c6060
...
...
@@ -2037,7 +2037,31 @@
}
},
promptForInvite
:
function
(
suggestion
)
{
var
reason
=
prompt
(
__
(
___
(
'
You are about to invite %1$s to the chat room "%2$s".
'
),
suggestion
.
text
.
label
,
this
.
model
.
get
(
'
id
'
))
+
__
(
"
You may optionally include a message, explaining the reason for the invitation.
"
)
);
if
(
reason
!==
null
)
{
this
.
chatroomview
.
directInvite
(
suggestion
.
text
.
value
,
reason
);
}
suggestion
.
target
.
value
=
''
;
},
inviteFormSubmitted
:
function
(
evt
)
{
evt
.
preventDefault
();
var
el
=
evt
.
target
.
querySelector
(
'
input.invited-contact
'
);
this
.
promptForInvite
({
'
target
'
:
el
,
'
text
'
:
{
'
label
'
:
el
.
value
,
'
value
'
:
el
.
value
}});
},
initInviteWidget
:
function
()
{
var
form
=
this
.
el
.
querySelector
(
'
form.room-invite
'
);
form
.
addEventListener
(
'
submit
'
,
this
.
inviteFormSubmitted
.
bind
(
this
));
var
el
=
this
.
el
.
querySelector
(
'
input.invited-contact
'
);
var
list
=
_converse
.
roster
.
map
(
function
(
item
)
{
var
label
=
item
.
get
(
'
fullname
'
)
||
item
.
get
(
'
jid
'
);
...
...
@@ -2047,16 +2071,7 @@
'
minChars
'
:
1
,
'
list
'
:
list
});
el
.
addEventListener
(
'
awesomplete-selectcomplete
'
,
function
(
suggestion
)
{
var
reason
=
prompt
(
__
(
___
(
'
You are about to invite %1$s to the chat room "%2$s".
'
),
suggestion
.
text
.
label
,
this
.
model
.
get
(
'
id
'
))
+
__
(
"
You may optionally include a message, explaining the reason for the invitation.
"
)
);
if
(
reason
!==
null
)
{
this
.
chatroomview
.
directInvite
(
suggestion
.
text
.
value
,
reason
);
}
el
.
value
=
''
;
}.
bind
(
this
));
el
.
addEventListener
(
'
awesomplete-selectcomplete
'
,
this
.
promptForInvite
.
bind
(
this
));
return
this
;
}
});
...
...
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