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
198
Issues
198
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
ae6eefdb
Commit
ae6eefdb
authored
Sep 23, 2015
by
Yann Leboulanger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new event after message stanza is built so it can be modified by plugins. Fixes
#8150
parent
2dd3c4c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
src/common/connection.py
src/common/connection.py
+13
-2
src/common/connection_handlers_events.py
src/common/connection_handlers_events.py
+6
-0
No files found.
src/common/connection.py
View file @
ae6eefdb
...
...
@@ -817,6 +817,8 @@ def __init__(self, name):
self
.
_nec_message_outgoing
)
gajim
.
ged
.
register_event_handler
(
'gc-message-outgoing'
,
ged
.
OUT_CORE
,
self
.
_nec_gc_message_outgoing
)
gajim
.
ged
.
register_event_handler
(
'stanza-message-outgoing'
,
ged
.
OUT_CORE
,
self
.
_nec_stanza_message_outgoing
)
# END __init__
def
cleanup
(
self
):
...
...
@@ -831,6 +833,8 @@ def cleanup(self):
self
.
_nec_message_outgoing
)
gajim
.
ged
.
remove_event_handler
(
'gc-message-outgoing'
,
ged
.
OUT_CORE
,
self
.
_nec_gc_message_outgoing
)
gajim
.
ged
.
remove_event_handler
(
'stanza-message-outgoing'
,
ged
.
OUT_CORE
,
self
.
_nec_stanza_message_outgoing
)
def
get_config_values_or_default
(
self
):
if
gajim
.
config
.
get_per
(
'accounts'
,
self
.
name
,
'keep_alives_enabled'
):
...
...
@@ -2111,9 +2115,11 @@ def cb(jid, msg, keyID, forward_from, session, original_message,
subject
,
type_
,
msg_iq
,
xhtml
):
if
isinstance
(
msg_iq
,
list
):
for
iq
in
msg_iq
:
msg_id
=
self
.
connection
.
send
(
iq
,
now
=
obj
.
now
)
gajim
.
nec
.
push_incoming_event
(
StanzaMessageOutgoingEvent
(
None
,
conn
=
self
,
msg_iq
=
iq
,
now
=
obj
.
now
))
else
:
msg_id
=
self
.
connection
.
send
(
msg_iq
,
now
=
obj
.
now
)
gajim
.
nec
.
push_incoming_event
(
StanzaMessageOutgoingEvent
(
None
,
conn
=
self
,
msg_iq
=
msg_iq
,
now
=
obj
.
now
))
gajim
.
nec
.
push_incoming_event
(
MessageSentEvent
(
None
,
conn
=
self
,
jid
=
jid
,
message
=
msg
,
keyID
=
keyID
,
chatstate
=
obj
.
chatstate
))
if
obj
.
callback
:
...
...
@@ -2139,6 +2145,11 @@ def cb(jid, msg, keyID, forward_from, session, original_message,
delayed
=
obj
.
delayed
,
attention
=
obj
.
attention
,
correction_msg
=
obj
.
correction_msg
,
callback
=
cb
)
def
_nec_stanza_message_outgoing
(
self
,
obj
):
if
obj
.
conn
.
name
!=
self
.
name
:
return
obj
.
msg_id
=
self
.
connection
.
send
(
obj
.
msg_iq
,
now
=
obj
.
now
)
def
send_contacts
(
self
,
contacts
,
fjid
,
type_
=
'message'
):
"""
Send contacts with RosterX (Xep-0144)
...
...
src/common/connection_handlers_events.py
View file @
ae6eefdb
...
...
@@ -2592,6 +2592,12 @@ def init(self):
def
generate
(
self
):
return
True
class
StanzaMessageOutgoingEvent
(
nec
.
NetworkOutgoingEvent
):
name
=
'stanza-message-outgoing'
base_network_events
=
[]
def
generate
(
self
):
return
True
class
GcMessageOutgoingEvent
(
nec
.
NetworkOutgoingEvent
):
name
=
'gc-message-outgoing'
...
...
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