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
Erik Huelsmann
gajim
Commits
ade56853
Commit
ade56853
authored
16 years ago
by
Brendan Taylor
Browse files
Options
Downloads
Patches
Plain Diff
moved session.remove_events. fixes #3942
parent
f8b12e3b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/chat_control.py
+1
-1
1 addition, 1 deletion
src/chat_control.py
src/common/stanza_session.py
+20
-0
20 additions, 0 deletions
src/common/stanza_session.py
src/session.py
+0
-15
0 additions, 15 deletions
src/session.py
with
21 additions
and
16 deletions
src/chat_control.py
+
1
−
1
View file @
ade56853
...
...
@@ -924,7 +924,7 @@ class ChatControlBase(MessageControl):
self
.
parent_win
.
get_active_control
()
==
self
and
\
self
.
parent_win
.
window
.
is_active
():
# we are at the end
if
not
self
.
session
.
remove_events
(
types_list
):
if
self
.
session
.
remove_events
(
types_list
):
# There were events to remove
self
.
redraw_after_event_removed
(
jid
)
...
...
This diff is collapsed.
Click to expand it.
src/common/stanza_session.py
+
20
−
0
View file @
ade56853
...
...
@@ -49,6 +49,26 @@ class StanzaSession(object):
return
self
.
loggable
and
account
not
in
no_log_for
and
self
.
jid
not
in
no_log_for
# remove events associated with this session from the queue
# returns True if any events were removed (unlike gajim.events.remove_events)
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
]
!=
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
)
if
not
r
:
any_removed
=
True
return
any_removed
def
generate_thread_id
(
self
):
return
""
.
join
([
random
.
choice
(
string
.
ascii_letters
)
for
x
in
xrange
(
0
,
32
)])
...
...
This diff is collapsed.
Click to expand it.
src/session.py
+
0
−
15
View file @
ade56853
...
...
@@ -26,21 +26,6 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
if
self
.
control
:
self
.
control
.
session
=
None
# remove events associated with this session from the queue
def
remove_events
(
self
,
types
):
any_removed
=
False
for
event
in
gajim
.
events
.
get_events
(
self
.
conn
,
self
.
jid
,
types
=
types
):
if
event
.
parameters
[
8
]
!=
self
:
continue
r
=
gajim
.
events
.
remove_events
(
self
.
conn
,
self
.
jid
,
event
)
if
not_any_removed
:
any_removed
=
r
return
any_removed
# extracts chatstate from a <message/> stanza
def
get_chatstate
(
self
,
msg
,
msgtxt
):
composing_xep
=
None
...
...
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