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
eta
gajim
Commits
9a5e49ac
Commit
9a5e49ac
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
try to prevent a major TB
parent
f521185a
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/logger.py
+1
-1
1 addition, 1 deletion
src/common/logger.py
src/tabbed_chat_window.py
+19
-16
19 additions, 16 deletions
src/tabbed_chat_window.py
with
20 additions
and
17 deletions
src/common/logger.py
+
1
−
1
View file @
9a5e49ac
...
...
@@ -73,7 +73,7 @@ class Logger:
ji
=
jid
nick
=
''
files
=
[]
if
kind
==
'
status
'
:
#we save time:jid:show:msg
if
kind
==
'
status
'
:
#
we save time:jid:show:msg
if
not
show
:
show
=
'
online
'
if
common
.
gajim
.
config
.
get
(
'
log_notif_in_user_file
'
):
...
...
This diff is collapsed.
Click to expand it.
src/tabbed_chat_window.py
+
19
−
16
View file @
9a5e49ac
...
...
@@ -733,12 +733,12 @@ timestamp, contact):
if
is_transport
:
return
#How many lines to restore and when to time them out
#
How many lines to restore and when to time them out
restore
=
gajim
.
config
.
get
(
'
restore_lines
'
)
time_out
=
gajim
.
config
.
get
(
'
restore_timeout
'
)
pos
=
0
#position, while reading from history
size
=
0
#how many lines we alreay retreived
lines
=
[]
#we'll need to reverse the lines from history
pos
=
0
#
position, while reading from history
size
=
0
#
how many lines we alreay retreived
lines
=
[]
#
we'll need to reverse the lines from history
count
=
gajim
.
logger
.
get_no_of_lines
(
jid
)
...
...
@@ -750,23 +750,26 @@ timestamp, contact):
now
=
time
.
time
()
while
size
<=
restore
:
if
pos
==
count
or
size
>
restore
-
1
:
#don't try to read beyond history, not read more than required
#
don't try to read beyond history, not read more than required
break
nb
,
line
=
gajim
.
logger
.
read
(
jid
,
count
-
1
-
pos
,
count
-
pos
)
pos
=
pos
+
1
if
(
now
-
float
(
line
[
0
][
0
]))
/
60
>=
time_out
:
#stop looking for messages if we found something too old
break
if
line
[
0
][
1
]
!=
'
sent
'
and
line
[
0
][
1
]
!=
'
recv
'
:
# we don't want to display status lines, do we?
continue
lines
.
append
(
line
[
0
])
size
=
size
+
1
print
line
# line is [] if log file for jid is not a file (does not exist or dir)
if
line
!=
[]:
if
(
now
-
float
(
line
[
0
][
0
]))
/
60
>=
time_out
:
# stop looking for messages if we found something too old
break
if
line
[
0
][
1
]
!=
'
sent
'
and
line
[
0
][
1
]
!=
'
recv
'
:
# we don't want to display status lines, do we?
continue
lines
.
append
(
line
[
0
])
size
=
size
+
1
lines
.
reverse
()
for
msg
in
lines
:
...
...
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