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
204
Issues
204
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
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
b7f87a52
Commit
b7f87a52
authored
Aug 05, 2010
by
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #1661
parent
27c1cee0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
src/gui.py
src/gui.py
+23
-3
No files found.
src/gui.py
View file @
b7f87a52
...
...
@@ -41,6 +41,18 @@ from message import Message
from
keyboard
import
read_char
from
common
import
is_jid_the_same
,
jid_get_domain
,
is_jid
# http://xmpp.org/extensions/xep-0045.html#errorstatus
ERROR_AND_STATUS_CODES
=
{
'401'
:
'A password is required'
,
'403'
:
'You are banned from the room'
,
'404'
:
'The room does
\'
nt exist'
,
'405'
:
'Your are not allowed to create a new room'
,
'406'
:
'A reserved nick must be used'
,
'407'
:
'You are not in the member list'
,
'409'
:
'This nickname is already in use or has been reserved'
,
'503'
:
'The maximum number of users has been reached'
,
}
def
doupdate
():
curses
.
doupdate
()
...
...
@@ -338,16 +350,24 @@ class Gui(object):
if
not
error
:
return
room
=
self
.
get_room_by_name
(
room
)
if
not
room
:
room
=
self
.
get_room_by_name
(
'Info'
)
code
=
error
.
getAttr
(
'code'
)
typ
=
error
.
getAttr
(
'type'
)
if
error
.
getTag
(
'text'
):
body
=
error
.
getTag
(
'text'
).
getData
()
# if error.getTag('text'):
# body = error.getTag('text').getData()
# else: # No description of the error is provided in the stanza
# # If it's a standard error, use our own messages
if
code
in
ERROR_AND_STATUS_CODES
.
keys
():
body
=
ERROR_AND_STATUS_CODES
[
code
]
else
:
body
=
_
(
'Unknown error'
)
self
.
add_message_to_room
(
room
,
_
(
'Error: %(code)s-%(msg)s: %(body)s'
%
{
'msg'
:
msg
,
'code'
:
code
,
'body'
:
body
}))
if
code
==
'401'
:
room
.
add
(
_
(
'To provide a password in order to join the room, type "/join / password" (replace "password" by the real password)'
))
self
.
add_message_to_room
(
room
,
_
(
'To provide a password in order to join the room, type "/join / password" (replace "password" by the real password)'
))
if
code
==
'409'
:
self
.
add_message_to_room
(
room
,
_
(
'You can join the room with specifying an other nick, by typing "/join /other_nick"'
))
self
.
refresh_window
()
def
private_message
(
self
,
stanza
):
...
...
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