Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
178
Issues
178
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
16276cd1
Commit
16276cd1
authored
May 06, 2014
by
mathieui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide our own (non-blocking) wrappers for room configuration functions
parent
467ae182
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
src/multiuserchat.py
src/multiuserchat.py
+20
-0
src/tabs/muctab.py
src/tabs/muctab.py
+2
-2
No files found.
src/multiuserchat.py
View file @
16276cd1
...
...
@@ -175,3 +175,23 @@ def set_user_affiliation(xmpp, muc_jid, affiliation, nick=None, jid=None, reason
import
traceback
log
.
debug
(
'Error setting the affiliation: %s'
,
traceback
.
format_exc
())
return
False
def
cancel_config
(
xmpp
,
room
):
query
=
ET
.
Element
(
'{http://jabber.org/protocol/muc#owner}query'
)
x
=
ET
.
Element
(
'{jabber:x:data}x'
,
type
=
'cancel'
)
query
.
append
(
x
)
iq
=
xmpp
.
makeIqSet
(
query
)
iq
[
'to'
]
=
room
iq
.
send
(
block
=
False
)
def
configure_room
(
xmpp
,
room
,
form
):
if
form
is
None
:
return
iq
=
xmpp
.
makeIqSet
()
iq
[
'to'
]
=
room
query
=
ET
.
Element
(
'{http://jabber.org/protocol/muc#owner}query'
)
form
=
form
.
getXML
(
'submit'
)
query
.
append
(
form
)
iq
.
append
(
query
)
iq
.
send
(
block
=
False
)
src/tabs/muctab.py
View file @
16276cd1
...
...
@@ -372,14 +372,14 @@ class MucTab(ChatTab):
"""
The user do not want to send his/her config, send an iq cancel
"""
self
.
core
.
xmpp
.
plugin
[
'xep_0045'
].
cancelConfig
(
self
.
name
)
muc
.
cancel_config
(
self
.
core
.
xmpp
,
self
.
name
)
self
.
core
.
close_tab
()
def
send_config
(
self
,
form
):
"""
The user sends his/her config to the server
"""
self
.
core
.
xmpp
.
plugin
[
'xep_0045'
].
configureRoom
(
self
.
name
,
form
)
muc
.
configure_room
(
self
.
core
.
xmpp
,
self
.
name
,
form
)
self
.
core
.
close_tab
()
def
command_cycle
(
self
,
arg
):
...
...
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