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
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
194
Issues
194
List
Boards
Labels
Service Desk
Milestones
Merge Requests
20
Merge Requests
20
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
b3229cb8
Commit
b3229cb8
authored
Jan 14, 2014
by
Yann Leboulanger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a new event that is sent just before changing status. Fixes
#7593
parent
e056dd28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
src/common/connection.py
src/common/connection.py
+8
-0
src/common/connection_handlers_events.py
src/common/connection_handlers_events.py
+4
-0
No files found.
src/common/connection.py
View file @
b3229cb8
...
...
@@ -709,12 +709,16 @@ def change_status(self, show, msg, auto=False):
if
gajim
.
HAVE_GPG
:
self
.
USE_GPG
=
True
self
.
gpg
=
gpg
.
GnuPG
(
gajim
.
config
.
get
(
'use_gpg_agent'
))
gajim
.
nec
.
push_incoming_event
(
BeforeChangeShowEvent
(
None
,
conn
=
self
,
show
=
show
,
message
=
msg
))
self
.
connect_and_init
(
show
,
msg
,
sign_msg
)
return
if
show
==
'offline'
:
self
.
connected
=
0
if
self
.
connection
:
gajim
.
nec
.
push_incoming_event
(
BeforeChangeShowEvent
(
None
,
conn
=
self
,
show
=
show
,
message
=
msg
))
p
=
nbxmpp
.
Presence
(
typ
=
'unavailable'
)
p
=
self
.
add_sha
(
p
,
False
)
if
msg
:
...
...
@@ -732,12 +736,16 @@ def change_status(self, show, msg, auto=False):
if
self
.
connected
==
1
:
return
if
show
==
'invisible'
:
gajim
.
nec
.
push_incoming_event
(
BeforeChangeShowEvent
(
None
,
conn
=
self
,
show
=
show
,
message
=
msg
))
self
.
_change_to_invisible
(
msg
)
return
if
show
not
in
[
'offline'
,
'online'
,
'chat'
,
'away'
,
'xa'
,
'dnd'
]:
return
-
1
was_invisible
=
self
.
connected
==
gajim
.
SHOW_LIST
.
index
(
'invisible'
)
self
.
connected
=
gajim
.
SHOW_LIST
.
index
(
show
)
gajim
.
nec
.
push_incoming_event
(
BeforeChangeShowEvent
(
None
,
conn
=
self
,
show
=
show
,
message
=
msg
))
if
was_invisible
:
self
.
_change_from_invisible
()
self
.
_update_status
(
show
,
msg
)
...
...
src/common/connection_handlers_events.py
View file @
b3229cb8
...
...
@@ -998,6 +998,10 @@ class OurShowEvent(nec.NetworkIncomingEvent):
name
=
'our-show'
base_network_events
=
[]
class
BeforeChangeShowEvent
(
nec
.
NetworkIncomingEvent
):
name
=
'before-change-show'
base_network_events
=
[]
class
MessageReceivedEvent
(
nec
.
NetworkIncomingEvent
,
HelperEvent
):
name
=
'message-received'
base_network_events
=
[
'raw-message-received'
]
...
...
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