user --> contact, space after # for devel comments
This commit is contained in:
parent
bcec82d8eb
commit
688c92fe4e
|
@ -43,7 +43,7 @@ GTKGUI_GLADE = 'gtkgui.glade'
|
||||||
|
|
||||||
class TabbedChatWindow(chat.Chat):
|
class TabbedChatWindow(chat.Chat):
|
||||||
"""Class for tabbed chat window"""
|
"""Class for tabbed chat window"""
|
||||||
def __init__(self, user, plugin, account):
|
def __init__(self, contact, plugin, account):
|
||||||
# we check that on opening new windows
|
# we check that on opening new windows
|
||||||
self.always_compact_view = gajim.config.get('always_compact_view_chat')
|
self.always_compact_view = gajim.config.get('always_compact_view_chat')
|
||||||
chat.Chat.__init__(self, plugin, account, 'tabbed_chat_window')
|
chat.Chat.__init__(self, plugin, account, 'tabbed_chat_window')
|
||||||
|
@ -64,7 +64,7 @@ class TabbedChatWindow(chat.Chat):
|
||||||
|
|
||||||
self.TARGET_TYPE_URI_LIST = 80
|
self.TARGET_TYPE_URI_LIST = 80
|
||||||
self.dnd_list = [ ( 'text/uri-list', 0, self.TARGET_TYPE_URI_LIST ) ]
|
self.dnd_list = [ ( 'text/uri-list', 0, self.TARGET_TYPE_URI_LIST ) ]
|
||||||
self.new_tab(user)
|
self.new_tab(contact)
|
||||||
self.show_title()
|
self.show_title()
|
||||||
|
|
||||||
# NOTE: if it not a window event, do not connect here (new_tab() autoconnects)
|
# NOTE: if it not a window event, do not connect here (new_tab() autoconnects)
|
||||||
|
@ -251,10 +251,10 @@ timestamp, contact):
|
||||||
else:
|
else:
|
||||||
contacts_list = [self.contacts[jid]]
|
contacts_list = [self.contacts[jid]]
|
||||||
|
|
||||||
user = contacts_list[0]
|
contact = contacts_list[0]
|
||||||
show = user.show
|
show = contact.show
|
||||||
jid = user.jid
|
jid = contact.jid
|
||||||
keyID = user.keyID
|
keyID = contact.keyID
|
||||||
|
|
||||||
for u in contacts_list:
|
for u in contacts_list:
|
||||||
if u.priority > prio:
|
if u.priority > prio:
|
||||||
|
@ -533,11 +533,11 @@ timestamp, contact):
|
||||||
elif event.state & gtk.gdk.SHIFT_MASK: # SHIFT + PAGE UP
|
elif event.state & gtk.gdk.SHIFT_MASK: # SHIFT + PAGE UP
|
||||||
conversation_textview.emit('key_press_event', event)
|
conversation_textview.emit('key_press_event', event)
|
||||||
elif event.keyval == gtk.keysyms.Up:
|
elif event.keyval == gtk.keysyms.Up:
|
||||||
if event.state & gtk.gdk.CONTROL_MASK: #Ctrl+UP
|
if event.state & gtk.gdk.CONTROL_MASK: # Ctrl+UP
|
||||||
self.sent_messages_scroll(jid, 'up', widget.get_buffer())
|
self.sent_messages_scroll(jid, 'up', widget.get_buffer())
|
||||||
return True # override the default gtk+ thing for ctrl+up
|
return True # override the default gtk+ thing for ctrl+up
|
||||||
elif event.keyval == gtk.keysyms.Down:
|
elif event.keyval == gtk.keysyms.Down:
|
||||||
if event.state & gtk.gdk.CONTROL_MASK: #Ctrl+Down
|
if event.state & gtk.gdk.CONTROL_MASK: # Ctrl+Down
|
||||||
self.sent_messages_scroll(jid, 'down', widget.get_buffer())
|
self.sent_messages_scroll(jid, 'down', widget.get_buffer())
|
||||||
return True # override the default gtk+ thing for ctrl+down
|
return True # override the default gtk+ thing for ctrl+down
|
||||||
elif event.keyval == gtk.keysyms.Return or \
|
elif event.keyval == gtk.keysyms.Return or \
|
||||||
|
@ -547,7 +547,7 @@ timestamp, contact):
|
||||||
return False
|
return False
|
||||||
elif (event.state & gtk.gdk.SHIFT_MASK):
|
elif (event.state & gtk.gdk.SHIFT_MASK):
|
||||||
return False
|
return False
|
||||||
if gajim.connections[self.account].connected < 2: #we are not connected
|
if gajim.connections[self.account].connected < 2: # we are not connected
|
||||||
dialogs.ErrorDialog(_('A connection is not available'),
|
dialogs.ErrorDialog(_('A connection is not available'),
|
||||||
_('Your message can not be sent until you are connected.')).get_response()
|
_('Your message can not be sent until you are connected.')).get_response()
|
||||||
return True
|
return True
|
||||||
|
@ -719,7 +719,7 @@ timestamp, contact):
|
||||||
def read_queue(self, jid):
|
def read_queue(self, jid):
|
||||||
"""read queue and print messages containted in it"""
|
"""read queue and print messages containted in it"""
|
||||||
l = gajim.awaiting_messages[self.account][jid]
|
l = gajim.awaiting_messages[self.account][jid]
|
||||||
user = self.contacts[jid]
|
contact = self.contacts[jid]
|
||||||
# Is it a pm ?
|
# Is it a pm ?
|
||||||
is_pm = False
|
is_pm = False
|
||||||
room_jid = jid.split('/', 1)[0]
|
room_jid = jid.split('/', 1)[0]
|
||||||
|
@ -757,10 +757,10 @@ timestamp, contact):
|
||||||
if self.plugin.systray_enabled:
|
if self.plugin.systray_enabled:
|
||||||
self.plugin.systray.remove_jid(jid, self.account, typ)
|
self.plugin.systray.remove_jid(jid, self.account, typ)
|
||||||
showOffline = gajim.config.get('showoffline')
|
showOffline = gajim.config.get('showoffline')
|
||||||
if (user.show == 'offline' or user.show == 'error') and \
|
if (contact.show == 'offline' or contact.show == 'error') and \
|
||||||
not showOffline:
|
not showOffline:
|
||||||
if len(gajim.contacts[self.account][jid]) == 1:
|
if len(gajim.contacts[self.account][jid]) == 1:
|
||||||
self.plugin.roster.really_remove_contact(user, self.account)
|
self.plugin.roster.really_remove_contact(contact, self.account)
|
||||||
|
|
||||||
def print_conversation(self, text, jid, contact = '', tim = None,
|
def print_conversation(self, text, jid, contact = '', tim = None,
|
||||||
encrypted = False, subject = None):
|
encrypted = False, subject = None):
|
||||||
|
@ -769,7 +769,7 @@ timestamp, contact):
|
||||||
if contact is set to another value: it's an outgoing message
|
if contact is set to another value: it's an outgoing message
|
||||||
if contact is set to print_queue: it is incomming from queue
|
if contact is set to print_queue: it is incomming from queue
|
||||||
if contact is not set: it's an incomming message"""
|
if contact is not set: it's an incomming message"""
|
||||||
user = self.contacts[jid]
|
contact = self.contacts[jid]
|
||||||
if contact == 'status':
|
if contact == 'status':
|
||||||
kind = 'status'
|
kind = 'status'
|
||||||
name = ''
|
name = ''
|
||||||
|
@ -788,10 +788,10 @@ timestamp, contact):
|
||||||
self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted)
|
self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted)
|
||||||
if not contact:
|
if not contact:
|
||||||
kind = 'incoming'
|
kind = 'incoming'
|
||||||
name = user.name
|
name = contact.name
|
||||||
elif contact == 'print_queue': # incoming message, but do not update time
|
elif contact == 'print_queue': # incoming message, but do not update time
|
||||||
kind = 'incoming_queue'
|
kind = 'incoming_queue'
|
||||||
name = user.name
|
name = contact.name
|
||||||
else:
|
else:
|
||||||
kind = 'outgoing'
|
kind = 'outgoing'
|
||||||
name = gajim.nicks[self.account]
|
name = gajim.nicks[self.account]
|
||||||
|
|
Loading…
Reference in New Issue