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
c71269c9
Commit
c71269c9
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
remove event for full jid and bar jid when we scroll conversation window. Fixes #4243
parent
6df6e9dd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/stanza_session.py
+18
-22
18 additions, 22 deletions
src/common/stanza_session.py
with
18 additions
and
22 deletions
src/common/stanza_session.py
+
18
−
22
View file @
c71269c9
...
...
@@ -73,20 +73,20 @@ class StanzaSession(object):
def
remove_events
(
self
,
types
):
any_removed
=
False
for
event
in
gajim
.
events
.
get_events
(
self
.
conn
.
name
,
self
.
jid
,
types
=
types
):
# the event wasn't in this session
if
(
event
.
type_
==
'
chat
'
and
event
.
parameters
[
8
]
!=
self
)
or
\
(
event
.
type_
==
'
printed_chat
'
and
event
.
parameters
[
0
].
session
!=
\
self
):
continue
for
j
in
(
self
.
jid
,
self
.
jid
.
getStripped
()):
for
event
in
gajim
.
events
.
get_events
(
self
.
conn
.
name
,
j
,
types
=
types
):
# the event wasn't in this session
if
(
event
.
type_
==
'
chat
'
and
event
.
parameters
[
8
]
!=
self
)
or
\
(
event
.
type_
==
'
printed_chat
'
and
event
.
parameters
[
0
].
session
!=
\
self
):
continue
# events.remove_events returns True when there were no events
# for some reason
r
=
gajim
.
events
.
remove_events
(
self
.
conn
.
name
,
self
.
jid
,
event
)
# events.remove_events returns True when there were no events
# for some reason
r
=
gajim
.
events
.
remove_events
(
self
.
conn
.
name
,
j
,
event
)
if
not
r
:
any_removed
=
True
if
not
r
:
any_removed
=
True
return
any_removed
...
...
@@ -340,8 +340,7 @@ class EncryptedStanzaSession(StanzaSession):
try
:
parsed
=
xmpp
.
Node
(
node
=
'
<node>
'
+
plaintext
+
'
</node>
'
)
except
:
raise
exceptions
.
DecryptionError
,
'
decrypted <data/> not parseable as XML
'
raise
exceptions
.
DecryptionError
,
'
decrypted <data/> not parseable as XML
'
for
child
in
parsed
.
getChildren
():
stanza
.
addChild
(
node
=
child
)
...
...
@@ -375,8 +374,7 @@ class EncryptedStanzaSession(StanzaSession):
m_o_calculated
=
self
.
hmac
(
self
.
km_o
,
crypto
.
encode_mpi
(
self
.
c_o
)
+
id_o
)
if
m_o_calculated
!=
m_o
:
raise
exceptions
.
NegotiationError
,
'
calculated m_%s differs from received m_%s
'
%
(
i_o
,
i_o
)
raise
exceptions
.
NegotiationError
,
'
calculated m_%s differs from received m_%s
'
%
(
i_o
,
i_o
)
if
i_o
==
'
a
'
and
self
.
sas_algs
==
'
sas28x5
'
:
# we don't need to calculate this if there's a verified retained secret
...
...
@@ -429,12 +427,10 @@ class EncryptedStanzaSession(StanzaSession):
hash
=
crypto
.
sha256
(
mac_o_calculated
)
if
not
eir_pubkey
.
verify
(
hash
,
signature
):
raise
exceptions
.
NegotiationError
,
'
public key signature verification failed!
'
raise
exceptions
.
NegotiationError
,
'
public key signature verification failed!
'
elif
mac_o_calculated
!=
mac_o
:
raise
exceptions
.
NegotiationError
,
'
calculated mac_%s differs from received mac_%s
'
%
(
i_o
,
i_o
)
raise
exceptions
.
NegotiationError
,
'
calculated mac_%s differs from received mac_%s
'
%
(
i_o
,
i_o
)
def
make_identity
(
self
,
form
,
dh_i
):
if
self
.
negotiated
[
'
send_pubkey
'
]:
...
...
@@ -446,7 +442,7 @@ class EncryptedStanzaSession(StanzaSession):
fields
)
pubkey_s
=
'
<RSAKeyValue xmlns=
"
http://www.w3.org/2000/09/xmldsig#
"'
'
><Modulus>%s</Modulus><Exponent>%s</Exponent></RSAKeyValue>
'
%
\
'
><Modulus>%s</Modulus><Exponent>%s</Exponent></RSAKeyValue>
'
%
\
tuple
(
cb_fields
)
else
:
pubkey_s
=
''
...
...
@@ -463,7 +459,7 @@ class EncryptedStanzaSession(StanzaSession):
signature
=
self
.
sign
(
mac_s
)
sign_s
=
'
<SignatureValue xmlns=
"
http://www.w3.org/2000/09/xmldsig#
"
>
'
'
%s</SignatureValue>
'
%
base64
.
b64encode
(
signature
)
'
%s</SignatureValue>
'
%
base64
.
b64encode
(
signature
)
if
self
.
negotiated
[
'
send_pubkey
'
]
==
'
hash
'
:
b64ed
=
base64
.
b64encode
(
self
.
hash
(
pubkey_s
))
...
...
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