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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Peter Shkenev
gajim
Commits
8a6113f1
Commit
8a6113f1
authored
19 years ago
by
nicfit
Browse files
Options
Downloads
Patches
Plain Diff
Final touches on chatstate notifications
parent
1984dc9e
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
+1
-6
1 addition, 6 deletions
src/chat.py
src/tabbed_chat_window.py
+5
-12
5 additions, 12 deletions
src/tabbed_chat_window.py
with
6 additions
and
18 deletions
src/chat.py
+
1
−
6
View file @
8a6113f1
...
...
@@ -160,14 +160,9 @@ def show_title(self):
self
.
window
.
set_title
(
title
)
gtkgui_helpers
.
set_unset_urgency_hint
(
self
.
window
,
unread
)
def
redraw_tab
(
self
,
contact
,
chatstate
=
None
):
def
redraw_tab
(
self
,
jid
,
chatstate
=
None
):
'''
redraw the label of the tab
if chatstate is given that means we have HE SENT US a chatstate
'''
if
isinstance
(
contact
,
unicode
):
jid
=
contact
else
:
jid
=
contact
.
jid
unread
=
''
if
self
.
nb_unread
[
jid
]
>
1
:
unread
=
'
[
'
+
unicode
(
self
.
nb_unread
[
jid
])
+
'
]
'
...
...
This diff is collapsed.
Click to expand it.
src/tabbed_chat_window.py
+
5
−
12
View file @
8a6113f1
...
...
@@ -368,8 +368,6 @@ def new_tab(self, contact):
message_textview
=
self
.
xmls
[
contact
.
jid
].
get_widget
(
'
message_textview
'
)
message_tv_buffer
=
message_textview
.
get_buffer
()
message_tv_buffer
.
connect
(
'
insert-text
'
,
self
.
on_message_tv_buffer_insert_text
,
contact
.
jid
)
message_tv_buffer
.
connect
(
'
changed
'
,
self
.
on_message_tv_buffer_changed
,
contact
)
...
...
@@ -381,7 +379,7 @@ def new_tab(self, contact):
self
.
tabbed_chat_popup_menu
=
xm
.
get_widget
(
'
tabbed_chat_popup_menu
'
)
chat
.
Chat
.
new_tab
(
self
,
contact
.
jid
)
self
.
redraw_tab
(
contact
)
self
.
redraw_tab
(
contact
.
jid
)
self
.
draw_widgets
(
contact
)
# restore previous conversation
...
...
@@ -408,7 +406,7 @@ def handle_incoming_chatstate(self, account, jid, chatstate):
contact
=
gajim
.
get_first_contact_instance_from_jid
(
account
,
jid
)
self
.
draw_name_banner
(
contact
,
chatstate
)
# update chatstate in tab for this chat
self
.
redraw_tab
(
contact
,
chatstate
)
self
.
redraw_tab
(
contact
.
jid
,
chatstate
)
def
check_for_possible_paused_chatstate
(
self
,
jid
):
'''
did we move mouse of that window or write something in message
...
...
@@ -470,17 +468,12 @@ def check_for_possible_inactive_chatstate(self, jid):
return
True
# loop forever
def
on_message_tv_buffer_insert_text
(
self
,
textbuffer
,
textiter
,
text
,
length
,
jid
):
self
.
kbd_activity_in_last_5_secs
=
True
self
.
kbd_activity_in_last_30_secs
=
True
# XXX: only send the event every N'th character after the first N... optimization
self
.
send_chatstate
(
'
composing
'
,
jid
)
def
on_message_tv_buffer_changed
(
self
,
textbuffer
,
contact
):
self
.
kbd_activity_in_last_5_secs
=
True
self
.
kbd_activity_in_last_30_secs
=
True
# All characters have been erased, undo composing
if
textbuffer
.
get_char_count
()
==
0
:
if
textbuffer
.
get_char_count
():
self
.
send_chatstate
(
'
composing
'
,
contact
.
jid
)
else
:
self
.
send_chatstate
(
'
active
'
,
contact
.
jid
)
def
reset_kbd_mouse_timeout_vars
(
self
):
...
...
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