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
6c7d811a
Commit
6c7d811a
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
fixing #294 [thanks to Nick Lopez!]
parent
2a3ac7a8
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/chat.py
+18
-3
18 additions, 3 deletions
src/chat.py
src/tabbed_chat_window.py
+2
-6
2 additions, 6 deletions
src/tabbed_chat_window.py
with
20 additions
and
9 deletions
src/chat.py
+
18
−
3
View file @
6c7d811a
...
...
@@ -56,6 +56,7 @@ class Chat:
self
.
tagStatus
=
{}
self
.
nb_unread
=
{}
self
.
last_message_time
=
{}
self
.
last_time_printout
=
{}
self
.
print_time_timeout_id
=
{}
self
.
names
=
{}
# what is printed in the tab (eg. user.name)
self
.
childs
=
{}
...
...
@@ -225,6 +226,7 @@ class Chat:
del
self
.
plugin
.
windows
[
self
.
account
][
kind
][
jid
]
del
self
.
nb_unread
[
jid
]
del
self
.
last_message_time
[
jid
]
del
self
.
last_time_printout
[
jid
]
del
self
.
xmls
[
jid
]
del
self
.
tagIn
[
jid
]
del
self
.
tagOut
[
jid
]
...
...
@@ -234,6 +236,7 @@ class Chat:
def
new_tab
(
self
,
jid
):
self
.
nb_unread
[
jid
]
=
0
self
.
last_message_time
[
jid
]
=
0
self
.
last_time_printout
[
jid
]
=
float
(
0.0
)
if
gajim
.
config
.
get
(
'
use_speller
'
)
and
'
gtkspell
'
in
globals
():
message_textview
=
self
.
xmls
[
jid
].
get_widget
(
'
message_textview
'
)
...
...
@@ -485,7 +488,7 @@ class Chat:
def
print_time_timeout
(
self
,
jid
):
if
not
jid
in
self
.
xmls
.
keys
():
return
0
return
False
if
gajim
.
config
.
get
(
'
print_time
'
)
==
'
sometimes
'
:
textview
=
self
.
xmls
[
jid
].
get_widget
(
'
conversation_textview
'
)
buffer
=
textview
.
get_buffer
()
...
...
@@ -501,10 +504,10 @@ class Chat:
if
end_rect
.
y
<=
(
visible_rect
.
y
+
visible_rect
.
height
):
#we are at the end
self
.
scroll_to_end
(
textview
)
return
1
return
True
# loop again
if
self
.
print_time_timeout_id
.
has_key
(
jid
):
del
self
.
print_time_timeout_id
[
jid
]
return
0
return
False
def
on_open_link_activate
(
self
,
widget
,
kind
,
text
):
self
.
plugin
.
launch_browser_mailer
(
kind
,
text
)
...
...
@@ -685,6 +688,18 @@ class Chat:
tim_format
=
time
.
strftime
(
format
,
tim
)
self
.
print_with_tag_list
(
buffer
,
tim_format
+
'
'
,
end_iter
,
other_tags_for_time
)
elif
gajim
.
config
.
get
(
'
print_time
'
)
==
'
sometimes
'
:
if
(
time
.
time
()
-
self
.
last_time_printout
[
jid
])
>
(
5
*
60
):
self
.
last_time_printout
[
jid
]
=
time
.
time
()
end_iter
=
buffer
.
get_end_iter
()
tim
=
time
.
localtime
()
tim_format
=
time
.
strftime
(
'
%H:%M
'
,
tim
)
buffer
.
insert_with_tags_by_name
(
end_iter
,
tim_format
+
'
\n
'
,
'
time_sometimes
'
)
#scroll to the end of the textview
end_rect
=
textview
.
get_iter_location
(
end_iter
)
visible_rect
=
textview
.
get_visible_rect
()
text_tags
=
other_tags_for_text
[:]
if
kind
==
'
status
'
:
...
...
This diff is collapsed.
Click to expand it.
src/tabbed_chat_window.py
+
2
−
6
View file @
6c7d811a
...
...
@@ -172,6 +172,7 @@ class Tabbed_chat_window(chat.Chat):
nontabbed_status_image
.
show
()
def
new_user
(
self
,
user
):
'''
when new tab is created
'''
self
.
names
[
user
.
jid
]
=
user
.
name
self
.
xmls
[
user
.
jid
]
=
gtk
.
glade
.
XML
(
GTKGUI_GLADE
,
'
chats_vbox
'
,
APP
)
self
.
childs
[
user
.
jid
]
=
self
.
xmls
[
user
.
jid
].
get_widget
(
'
chats_vbox
'
)
...
...
@@ -181,6 +182,7 @@ class Tabbed_chat_window(chat.Chat):
self
.
redraw_tab
(
user
.
jid
)
self
.
draw_widgets
(
user
)
uf_show
=
helpers
.
get_uf_show
(
user
.
show
)
s
=
_
(
'
%s is %s
'
)
%
(
user
.
name
,
uf_show
)
if
user
.
status
:
...
...
@@ -196,12 +198,6 @@ class Tabbed_chat_window(chat.Chat):
if
self
.
plugin
.
queues
[
self
.
account
].
has_key
(
user
.
jid
):
self
.
read_queue
(
user
.
jid
)
if
gajim
.
config
.
get
(
'
print_time
'
)
==
'
sometimes
'
:
self
.
print_time_timeout
(
user
.
jid
)
self
.
print_time_timeout_id
[
user
.
jid
]
=
gobject
.
timeout_add
(
300000
,
self
.
print_time_timeout
,
user
.
jid
)
def
on_message_textview_key_press_event
(
self
,
widget
,
event
):
"""
When a key is pressed:
if enter is pressed without the shit key, message (if not empty) is sent
...
...
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