Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
197
Issues
197
List
Boards
Labels
Service Desk
Milestones
Merge Requests
20
Merge Requests
20
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
1962b231
Commit
1962b231
authored
May 04, 2008
by
Brendan Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pm bugfix
parent
be0af1a5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
42 deletions
+48
-42
src/chat_control.py
src/chat_control.py
+12
-12
src/gajim.py
src/gajim.py
+1
-0
src/groupchat_control.py
src/groupchat_control.py
+7
-6
src/message_control.py
src/message_control.py
+11
-19
src/message_window.py
src/message_window.py
+17
-5
No files found.
src/chat_control.py
View file @
1962b231
...
...
@@ -1586,7 +1586,7 @@ def get_tab_label(self, chatstate):
elif
num_unread
>
1
:
unread
=
'['
+
unicode
(
num_unread
)
+
']'
# Draw tab label using chatstate
# Draw tab label using chatstate
theme
=
gajim
.
config
.
get
(
'roster_theme'
)
color
=
None
if
not
chatstate
:
...
...
@@ -1846,6 +1846,7 @@ def shutdown(self):
self
.
contact
.
chatstate
=
None
self
.
contact
.
our_chatstate
=
None
# terminate session
self
.
session
.
control
=
None
# Disconnect timer callbacks
...
...
@@ -2077,12 +2078,11 @@ def read_queue(self):
# reset to status image in gc if it is a pm
# Is it a pm ?
room_jid
,
nick
=
gajim
.
get_room_and_nick_from_fjid
(
jid
)
# XXX fixme somehow
# control = gajim.interface.msg_win_mgr.get_control(room_jid, self.account)
# if control and control.type_id == message_control.TYPE_GC:
# control.update_ui()
# control.parent_win.show_title()
# typ = 'pm'
control
=
gajim
.
interface
.
msg_win_mgr
.
get_gc_control
(
room_jid
,
self
.
account
)
if
control
and
control
.
type_id
==
message_control
.
TYPE_GC
:
control
.
update_ui
()
control
.
parent_win
.
show_title
()
typ
=
'pm'
self
.
redraw_after_event_removed
(
jid
)
if
(
self
.
contact
.
show
in
(
'offline'
,
'error'
)):
...
...
@@ -2093,8 +2093,8 @@ def read_queue(self):
len
(
gajim
.
contacts
.
get_contacts
(
self
.
account
,
jid
))
<
2
):
gajim
.
interface
.
roster
.
really_remove_contact
(
self
.
contact
,
self
.
account
)
#
elif typ == 'pm':
#
control.remove_contact(nick)
elif
typ
==
'pm'
:
control
.
remove_contact
(
nick
)
def
show_bigger_avatar
(
self
,
small_avatar
):
'''resizes the avatar, if needed, so it has at max half the screen size
...
...
@@ -2140,18 +2140,18 @@ def show_bigger_avatar(self, small_avatar):
window
.
set_app_paintable
(
True
)
if
gtk
.
gtk_version
>=
(
2
,
10
,
0
)
and
gtk
.
pygtk_version
>=
(
2
,
10
,
0
):
window
.
set_type_hint
(
gtk
.
gdk
.
WINDOW_TYPE_HINT_TOOLTIP
)
window
.
realize
()
window
.
window
.
set_back_pixmap
(
pixmap
,
False
)
# make it transparent
window
.
window
.
shape_combine_mask
(
mask
,
0
,
0
)
# make the bigger avatar window show up centered
# make the bigger avatar window show up centered
x0
,
y0
=
small_avatar
.
window
.
get_origin
()
x0
+=
small_avatar
.
allocation
.
x
y0
+=
small_avatar
.
allocation
.
y
center_x
=
x0
+
(
small_avatar
.
allocation
.
width
/
2
)
center_y
=
y0
+
(
small_avatar
.
allocation
.
height
/
2
)
pos_x
,
pos_y
=
center_x
-
(
avatar_w
/
2
),
center_y
-
(
avatar_h
/
2
)
pos_x
,
pos_y
=
center_x
-
(
avatar_w
/
2
),
center_y
-
(
avatar_h
/
2
)
window
.
move
(
pos_x
,
pos_y
)
# make the cursor invisible so we can see the image
invisible_cursor
=
gtkgui_helpers
.
get_invisible_cursor
()
...
...
src/gajim.py
View file @
1962b231
...
...
@@ -1924,6 +1924,7 @@ def _cb(on_success):
if
ctrl
:
new_sess
=
gajim
.
connections
[
account
].
make_new_session
(
str
(
jid
))
ctrl
.
set_session
(
new_sess
)
gajim
.
connections
[
account
].
delete_session
(
str
(
jid
),
session
.
thread_id
)
if
was_encrypted
:
ctrl
.
print_esession_details
()
...
...
src/groupchat_control.py
View file @
1962b231
...
...
@@ -604,7 +604,7 @@ def on_private_message(self, nick, msg, tim, xhtml, session, msg_id = None):
no_queue
=
len
(
gajim
.
events
.
get_events
(
self
.
account
,
fjid
))
==
0
# We print if window is opened
pm_control
=
gajim
.
interface
.
msg_win_mgr
.
get_control
(
fjid
,
self
.
account
,
session
)
pm_control
=
session
.
control
if
pm_control
:
pm_control
.
print_conversation
(
msg
,
tim
=
tim
,
xhtml
=
xhtml
)
...
...
@@ -632,7 +632,7 @@ def on_private_message(self, nick, msg, tim, xhtml, session, msg_id = None):
self
.
parent_win
.
show_title
()
self
.
parent_win
.
redraw_tab
(
self
)
else
:
self
.
_start_private_message
(
nick
,
session
)
self
.
_start_private_message
(
nick
)
# Scroll to line
self
.
list_treeview
.
expand_row
(
path
[
0
:
1
],
False
)
self
.
list_treeview
.
scroll_to_cell
(
path
)
...
...
@@ -891,10 +891,9 @@ def on_send_pm(self, widget = None, model = None, iter = None, nick = None,
nick
=
model
[
iter
][
C_NICK
].
decode
(
'utf-8'
)
fjid
=
gajim
.
construct_fjid
(
self
.
room_jid
,
nick
)
# 'fake' jid
self
.
_start_private_message
(
nick
)
ctrl
=
self
.
_start_private_message
(
nick
)
if
msg
:
gajim
.
interface
.
msg_win_mgr
.
get_control
(
fjid
,
self
.
account
).
\
send_message
(
msg
)
ctrl
.
send_message
(
msg
)
def
on_send_file
(
self
,
widget
,
gc_contact
):
'''sends a file to a contact in the room'''
...
...
@@ -2041,6 +2040,8 @@ def _start_private_message(self, nick):
win
.
set_active_tab
(
ctrl
)
win
.
window
.
present
()
return
ctrl
def
on_row_activated
(
self
,
widget
,
path
):
'''When an iter is activated (dubblick or single click if gnome is set
this way'''
...
...
@@ -2099,7 +2100,7 @@ def on_list_treeview_button_press_event(self, widget, event):
return
if
gajim
.
single_click
and
not
event
.
state
&
gtk
.
gdk
.
SHIFT_MASK
:
self
.
on_row_activated
(
widget
,
path
)
self
.
on_row_activated
(
widget
,
path
)
return
True
else
:
model
=
widget
.
get_model
()
...
...
src/message_control.py
View file @
1962b231
...
...
@@ -117,25 +117,24 @@ def get_specific_unread(self):
return
len
(
gajim
.
events
.
get_events
(
self
.
account
,
self
.
contact
.
jid
))
def
set_session
(
self
,
session
):
if
hasattr
(
self
,
'session'
)
and
session
==
self
.
session
:
return
was_encrypted
=
False
oldsession
=
None
if
hasattr
(
self
,
'session'
):
oldsession
=
self
.
session
if
hasattr
(
self
,
'session'
)
and
self
.
session
:
if
self
.
session
.
enable_encryption
:
was_encrypted
=
True
gajim
.
connections
[
self
.
account
].
delete_session
(
self
.
session
.
jid
,
self
.
session
.
thread_id
)
if
oldsession
and
session
==
oldsession
:
return
self
.
session
=
session
if
session
:
session
.
control
=
self
if
was_encrypted
:
self
.
print_esession_details
()
if
oldsession
:
self
.
parent_win
.
change_thread_key
(
self
.
contact
.
jid
,
self
.
account
,
oldsession
.
thread_id
,
session
.
thread_id
)
if
oldsession
.
enable_encryption
:
self
.
print_esession_details
()
def
send_message
(
self
,
message
,
keyID
=
''
,
type
=
'chat'
,
chatstate
=
None
,
msg_id
=
None
,
composing_xep
=
None
,
resource
=
None
,
...
...
@@ -144,13 +143,6 @@ def send_message(self, message, keyID = '', type = 'chat',
'''
jid
=
self
.
contact
.
jid
if
not
self
.
session
:
print
(
'uhoh new session'
)
fjid
=
self
.
contact
.
get_full_jid
()
new_session
=
gajim
.
connections
[
self
.
account
].
make_new_session
(
fjid
)
self
.
set_session
(
new_session
)
# Send and update history
return
gajim
.
connections
[
self
.
account
].
send_message
(
jid
,
message
,
keyID
,
type
=
type
,
chatstate
=
chatstate
,
msg_id
=
msg_id
,
...
...
src/message_window.py
View file @
1962b231
...
...
@@ -429,6 +429,7 @@ def remove_tab(self, ctrl, method, reason = None, force = False):
fjid
=
ctrl
.
get_full_jid
()
thread_id
=
ctrl
.
session
.
thread_id
del
self
.
_controls
[
ctrl
.
account
][
fjid
][
thread_id
]
if
len
(
self
.
_controls
[
ctrl
.
account
][
fjid
])
==
0
:
...
...
@@ -567,19 +568,30 @@ def get_controls(self, jid, acct):
return
[]
def
change_key
(
self
,
old_jid
,
new_jid
,
acct
):
'''Change the key of a control'''
'''Change the
JID
key of a control'''
try
:
# Check if control exists
ctrl
=
self
.
_controls
[
acct
][
old_jid
]
except
:
# Check if control
s
exists
ctrl
s
=
self
.
_controls
[
acct
][
old_jid
]
except
KeyError
:
return
self
.
_controls
[
acct
][
new_jid
]
=
self
.
_controls
[
acct
][
old_jid
]
self
.
_controls
[
acct
][
new_jid
]
=
ctrls
del
self
.
_controls
[
acct
][
old_jid
]
if
old_jid
in
gajim
.
last_message_time
[
acct
]:
gajim
.
last_message_time
[
acct
][
new_jid
]
=
\
gajim
.
last_message_time
[
acct
][
old_jid
]
del
gajim
.
last_message_time
[
acct
][
old_jid
]
def
change_thread_key
(
self
,
jid
,
acct
,
old_thread_id
,
new_thread_id
):
'''Change the thread_id key of a control'''
try
:
# Check if control exists
ctrl
=
self
.
_controls
[
acct
][
jid
][
old_thread_id
]
except
KeyError
:
return
self
.
_controls
[
acct
][
jid
][
new_thread_id
]
=
ctrl
del
self
.
_controls
[
acct
][
jid
][
old_thread_id
]
def
controls
(
self
):
for
jid_dict
in
self
.
_controls
.
values
():
for
ctrl_dict
in
jid_dict
.
values
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment