Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
15ab3704
Commit
15ab3704
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
remove duplicated STATUS_LIST variable
parent
c8dc8cd7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/connection.py
+9
-9
9 additions, 9 deletions
src/common/connection.py
src/common/connection_handlers.py
+6
-8
6 additions, 8 deletions
src/common/connection_handlers.py
with
15 additions
and
17 deletions
src/common/connection.py
+
9
−
9
View file @
15ab3704
...
...
@@ -223,7 +223,7 @@ class Connection(ConnectionHandlers):
if
gajim
.
account_is_connected
(
self
.
name
):
# we cannot change our status to offline or connecting
# after we auth to server
self
.
old_show
=
STATUS
_LIST
[
self
.
connected
]
self
.
old_show
=
gajim
.
SHOW
_LIST
[
self
.
connected
]
self
.
connected
=
0
if
not
self
.
on_purpose
:
self
.
dispatch
(
'
STATUS
'
,
'
offline
'
)
...
...
@@ -927,7 +927,7 @@ class Connection(ConnectionHandlers):
# active the privacy rule
self
.
privacy_rules_supported
=
True
self
.
activate_privacy_rule
(
'
invisible
'
)
self
.
connected
=
STATUS
_LIST
.
index
(
'
invisible
'
)
self
.
connected
=
gajim
.
SHOW
_LIST
.
index
(
'
invisible
'
)
self
.
status
=
msg
priority
=
unicode
(
gajim
.
get_priority
(
self
.
name
,
'
invisible
'
))
p
=
common
.
xmpp
.
Presence
(
priority
=
priority
)
...
...
@@ -1009,7 +1009,7 @@ class Connection(ConnectionHandlers):
self
.
connection
.
send
(
iq
)
def
send_custom_status
(
self
,
show
,
msg
,
jid
):
if
not
show
in
STATUS
_LIST
:
if
not
show
in
gajim
.
SHOW
_LIST
:
return
-
1
if
not
self
.
connection
:
return
...
...
@@ -1034,7 +1034,7 @@ class Connection(ConnectionHandlers):
self
.
connection
.
send
(
p
)
def
change_status
(
self
,
show
,
msg
,
auto
=
False
):
if
not
show
in
STATUS
_LIST
:
if
not
show
in
gajim
.
SHOW
_LIST
:
return
-
1
sshow
=
helpers
.
get_xmpp_show
(
show
)
if
not
msg
:
...
...
@@ -1092,8 +1092,8 @@ class Connection(ConnectionHandlers):
signed
=
self
.
get_signed_presence
(
msg
)
self
.
send_invisible_presence
(
msg
,
signed
)
return
was_invisible
=
self
.
connected
==
STATUS
_LIST
.
index
(
'
invisible
'
)
self
.
connected
=
STATUS
_LIST
.
index
(
show
)
was_invisible
=
self
.
connected
==
gajim
.
SHOW
_LIST
.
index
(
'
invisible
'
)
self
.
connected
=
gajim
.
SHOW
_LIST
.
index
(
show
)
if
was_invisible
and
self
.
privacy_rules_supported
:
iq
=
self
.
build_privacy_rule
(
'
visible
'
,
'
allow
'
)
self
.
connection
.
send
(
iq
)
...
...
@@ -1117,7 +1117,7 @@ class Connection(ConnectionHandlers):
self
.
dispatch
(
'
STATUS
'
,
'
offline
'
)
def
get_status
(
self
):
return
STATUS
_LIST
[
self
.
connected
]
return
gajim
.
SHOW
_LIST
[
self
.
connected
]
def
send_motd
(
self
,
jid
,
subject
=
''
,
msg
=
''
,
xhtml
=
None
):
...
...
@@ -1561,7 +1561,7 @@ class Connection(ConnectionHandlers):
def
send_agent_status
(
self
,
agent
,
ptype
):
if
not
self
.
connection
:
return
show
=
helpers
.
get_xmpp_show
(
STATUS
_LIST
[
self
.
connected
])
show
=
helpers
.
get_xmpp_show
(
gajim
.
SHOW
_LIST
[
self
.
connected
])
p
=
common
.
xmpp
.
Presence
(
to
=
agent
,
typ
=
ptype
,
show
=
show
)
p
=
self
.
add_sha
(
p
,
ptype
!=
'
unavailable
'
)
self
.
connection
.
send
(
p
)
...
...
@@ -1584,7 +1584,7 @@ class Connection(ConnectionHandlers):
# FIXME: This room JID needs to be normalized; see #1364
if
not
self
.
connection
:
return
show
=
helpers
.
get_xmpp_show
(
STATUS
_LIST
[
self
.
connected
])
show
=
helpers
.
get_xmpp_show
(
gajim
.
SHOW
_LIST
[
self
.
connected
])
if
show
==
'
invisible
'
:
# Never join a room when invisible
return
...
...
This diff is collapsed.
Click to expand it.
src/common/connection_handlers.py
+
6
−
8
View file @
15ab3704
...
...
@@ -59,8 +59,6 @@ if dbus_support.supported:
import
logging
log
=
logging
.
getLogger
(
'
gajim.c.connection_handlers
'
)
STATUS_LIST
=
[
'
offline
'
,
'
connecting
'
,
'
online
'
,
'
chat
'
,
'
away
'
,
'
xa
'
,
'
dnd
'
,
'
invisible
'
,
'
error
'
]
# kind of events we can wait for an answer
VCARD_PUBLISHED
=
'
vcard_published
'
VCARD_ARRIVED
=
'
vcard_arrived
'
...
...
@@ -1084,12 +1082,12 @@ class ConnectionVcard:
self
.
save_vcard_to_hd
(
our_jid
,
vcard_iq
)
# Send new presence if sha changed and we are not invisible
if
self
.
vcard_sha
!=
new_sha
and
STATUS
_LIST
[
self
.
connected
]
!=
\
if
self
.
vcard_sha
!=
new_sha
and
gajim
.
SHOW
_LIST
[
self
.
connected
]
!=
\
'
invisible
'
:
if
not
self
.
connection
or
self
.
connected
<
2
:
return
self
.
vcard_sha
=
new_sha
sshow
=
helpers
.
get_xmpp_show
(
STATUS
_LIST
[
self
.
connected
])
sshow
=
helpers
.
get_xmpp_show
(
gajim
.
SHOW
_LIST
[
self
.
connected
])
p
=
common
.
xmpp
.
Presence
(
typ
=
None
,
priority
=
self
.
priority
,
show
=
sshow
,
status
=
self
.
status
)
p
=
self
.
add_sha
(
p
)
...
...
@@ -1256,11 +1254,11 @@ class ConnectionVcard:
if
self
.
vcard_sha
==
avatar_sha
:
return
self
.
vcard_sha
=
avatar_sha
if
STATUS
_LIST
[
self
.
connected
]
==
'
invisible
'
:
if
gajim
.
SHOW
_LIST
[
self
.
connected
]
==
'
invisible
'
:
return
if
not
self
.
connection
:
return
sshow
=
helpers
.
get_xmpp_show
(
STATUS
_LIST
[
self
.
connected
])
sshow
=
helpers
.
get_xmpp_show
(
gajim
.
SHOW
_LIST
[
self
.
connected
])
p
=
common
.
xmpp
.
Presence
(
typ
=
None
,
priority
=
self
.
priority
,
show
=
sshow
,
status
=
self
.
status
)
p
=
self
.
add_sha
(
p
)
...
...
@@ -2042,7 +2040,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
status
=
prs
.
getStatus
()
or
''
show
=
prs
.
getShow
()
if
not
show
in
STATUS
_LIST
:
if
not
show
in
gajim
.
SHOW
_LIST
:
show
=
''
# We ignore unknown show
if
not
ptype
and
not
show
:
show
=
'
online
'
...
...
@@ -2399,7 +2397,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
_
(
'
You will be connected to %s without OpenPGP.
'
)
%
self
.
name
))
self
.
USE_GPG
=
False
signed
=
''
self
.
connected
=
STATUS
_LIST
.
index
(
show
)
self
.
connected
=
gajim
.
SHOW
_LIST
.
index
(
show
)
sshow
=
helpers
.
get_xmpp_show
(
show
)
# send our presence
if
show
==
'
invisible
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment