coding standards
This commit is contained in:
parent
816dc776b0
commit
554764400b
|
@ -883,7 +883,6 @@ class GroupchatControl(ChatControlBase):
|
||||||
text, the second, what sound to play.'''
|
text, the second, what sound to play.'''
|
||||||
highlight, sound = (None, None)
|
highlight, sound = (None, None)
|
||||||
|
|
||||||
|
|
||||||
# Are any of the defined highlighting words in the text?
|
# Are any of the defined highlighting words in the text?
|
||||||
if self.needs_visual_notification(text):
|
if self.needs_visual_notification(text):
|
||||||
highlight = True
|
highlight = True
|
||||||
|
@ -1013,7 +1012,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
if self.is_anonymous and gc_contact.affiliation not in ['admin', 'owner']\
|
if self.is_anonymous and gc_contact.affiliation not in ['admin', 'owner']\
|
||||||
and self_contact.affiliation in ['admin', 'owner']:
|
and self_contact.affiliation in ['admin', 'owner']:
|
||||||
prim_text = _('Really send file?')
|
prim_text = _('Really send file?')
|
||||||
sec_text = _('If you send a file to %s, he/she will know your real Jabber ID.') % gc_contact.name
|
sec_text = _('If you send a file to %s, he/she will know your real '
|
||||||
|
'Jabber ID.') % gc_contact.name
|
||||||
dialog = dialogs.NonModalConfirmationDialog(prim_text, sec_text,
|
dialog = dialogs.NonModalConfirmationDialog(prim_text, sec_text,
|
||||||
on_response_ok = (_on_send_files, gc_contact))
|
on_response_ok = (_on_send_files, gc_contact))
|
||||||
dialog.popup()
|
dialog.popup()
|
||||||
|
@ -1044,8 +1044,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
color = gtkgui_helpers._get_fade_color(self.list_treeview,
|
color = gtkgui_helpers._get_fade_color(self.list_treeview,
|
||||||
selected, focus)
|
selected, focus)
|
||||||
colorstring = "#%04x%04x%04x" % (color.red, color.green, color.blue)
|
colorstring = "#%04x%04x%04x" % (color.red, color.green, color.blue)
|
||||||
name += '\n' '<span size="small" style="italic" foreground="%s">%s</span>'\
|
name += '\n<span size="small" style="italic" foreground="%s">%s'
|
||||||
% (colorstring, gobject.markup_escape_text(status))
|
'</span>' % (colorstring, gobject.markup_escape_text(status))
|
||||||
|
|
||||||
model[iter_][C_IMG] = image
|
model[iter_][C_IMG] = image
|
||||||
model[iter_][C_TEXT] = name
|
model[iter_][C_TEXT] = name
|
||||||
|
@ -1505,7 +1505,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
message_array = message_array[0].split()
|
message_array = message_array[0].split()
|
||||||
invitee = message_array.pop(0)
|
invitee = message_array.pop(0)
|
||||||
reason = ' '.join(message_array)
|
reason = ' '.join(message_array)
|
||||||
gajim.connections[self.account].send_invite(self.room_jid, invitee, reason)
|
gajim.connections[self.account].send_invite(self.room_jid, invitee,
|
||||||
|
reason)
|
||||||
s = _('Invited %(contact_jid)s to %(room_jid)s.') % {
|
s = _('Invited %(contact_jid)s to %(room_jid)s.') % {
|
||||||
'contact_jid': invitee,
|
'contact_jid': invitee,
|
||||||
'room_jid': self.room_jid}
|
'room_jid': self.room_jid}
|
||||||
|
@ -1519,7 +1520,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
if len(message_array):
|
if len(message_array):
|
||||||
room_jid = message_array[0]
|
room_jid = message_array[0]
|
||||||
if room_jid.find('@') < 0:
|
if room_jid.find('@') < 0:
|
||||||
room_jid = room_jid + '@' + gajim.get_server_from_jid(self.room_jid)
|
room_jid = room_jid + '@' + gajim.get_server_from_jid(
|
||||||
|
self.room_jid)
|
||||||
else:
|
else:
|
||||||
room_jid = '@' + gajim.get_server_from_jid(self.room_jid)
|
room_jid = '@' + gajim.get_server_from_jid(self.room_jid)
|
||||||
if room_jid.find('/') >= 0:
|
if room_jid.find('/') >= 0:
|
||||||
|
@ -1641,9 +1643,9 @@ class GroupchatControl(ChatControlBase):
|
||||||
self.print_conversation(_('Commands: %s') % GroupchatControl.MUC_CMDS,
|
self.print_conversation(_('Commands: %s') % GroupchatControl.MUC_CMDS,
|
||||||
'info')
|
'info')
|
||||||
elif command == 'ban':
|
elif command == 'ban':
|
||||||
s = _('Usage: /%s <nickname|JID> [reason], bans the JID from the group chat.'
|
s = _('Usage: /%s <nickname|JID> [reason], bans the JID from the group'
|
||||||
' The nickname of an occupant may be substituted, but not if it '
|
' chat. The nickname of an occupant may be substituted, but not if '
|
||||||
'contains "@". If the JID is currently in the group chat, '
|
'it contains "@". If the JID is currently in the group chat, '
|
||||||
'he/she/it will also be kicked. Does NOT support spaces in '
|
'he/she/it will also be kicked. Does NOT support spaces in '
|
||||||
'nickname.') % command
|
'nickname.') % command
|
||||||
self.print_conversation(s, 'info')
|
self.print_conversation(s, 'info')
|
||||||
|
@ -1773,7 +1775,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
fjid = self.room_jid + '/' + nick
|
fjid = self.room_jid + '/' + nick
|
||||||
ctrl = gajim.interface.msg_win_mgr.get_gc_control(fjid, self.account)
|
ctrl = gajim.interface.msg_win_mgr.get_gc_control(fjid, self.account)
|
||||||
if ctrl:
|
if ctrl:
|
||||||
contact = gajim.contacts.get_gc_contact(self.account, self.room_jid, nick)
|
contact = gajim.contacts.get_gc_contact(self.account, self.room_jid,
|
||||||
|
nick)
|
||||||
contact.show = 'offline'
|
contact.show = 'offline'
|
||||||
contact.status = ''
|
contact.status = ''
|
||||||
ctrl.update_ui()
|
ctrl.update_ui()
|
||||||
|
@ -1876,7 +1879,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
if c.affiliation == 'owner':
|
if c.affiliation == 'owner':
|
||||||
gajim.connections[self.account].request_gc_config(self.room_jid)
|
gajim.connections[self.account].request_gc_config(self.room_jid)
|
||||||
elif c.affiliation == 'admin':
|
elif c.affiliation == 'admin':
|
||||||
if self.room_jid not in gajim.interface.instances[self.account]['gc_config']:
|
if self.room_jid not in gajim.interface.instances[self.account][
|
||||||
|
'gc_config']:
|
||||||
gajim.interface.instances[self.account]['gc_config'][self.room_jid]\
|
gajim.interface.instances[self.account]['gc_config'][self.room_jid]\
|
||||||
= config.GroupchatConfigWindow(self.account, self.room_jid)
|
= config.GroupchatConfigWindow(self.account, self.room_jid)
|
||||||
|
|
||||||
|
@ -2330,7 +2334,6 @@ class GroupchatControl(ChatControlBase):
|
||||||
else:
|
else:
|
||||||
self.tooltip.hide_tooltip()
|
self.tooltip.hide_tooltip()
|
||||||
|
|
||||||
|
|
||||||
def grant_voice(self, widget, nick):
|
def grant_voice(self, widget, nick):
|
||||||
'''grant voice privilege to a user'''
|
'''grant voice privilege to a user'''
|
||||||
gajim.connections[self.account].gc_set_role(self.room_jid, nick,
|
gajim.connections[self.account].gc_set_role(self.room_jid, nick,
|
||||||
|
@ -2375,7 +2378,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
|
|
||||||
def grant_admin(self, widget, jid):
|
def grant_admin(self, widget, jid):
|
||||||
'''grant administrative privilege to a user'''
|
'''grant administrative privilege to a user'''
|
||||||
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid, 'admin')
|
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid,
|
||||||
|
'admin')
|
||||||
|
|
||||||
def revoke_admin(self, widget, jid):
|
def revoke_admin(self, widget, jid):
|
||||||
'''revoke administrative privilege to a user'''
|
'''revoke administrative privilege to a user'''
|
||||||
|
@ -2384,11 +2388,13 @@ class GroupchatControl(ChatControlBase):
|
||||||
|
|
||||||
def grant_owner(self, widget, jid):
|
def grant_owner(self, widget, jid):
|
||||||
'''grant owner privilege to a user'''
|
'''grant owner privilege to a user'''
|
||||||
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid, 'owner')
|
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid,
|
||||||
|
'owner')
|
||||||
|
|
||||||
def revoke_owner(self, widget, jid):
|
def revoke_owner(self, widget, jid):
|
||||||
'''revoke owner privilege to a user'''
|
'''revoke owner privilege to a user'''
|
||||||
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid, 'admin')
|
gajim.connections[self.account].gc_set_affiliation(self.room_jid, jid,
|
||||||
|
'admin')
|
||||||
|
|
||||||
def on_info(self, widget, nick):
|
def on_info(self, widget, nick):
|
||||||
'''Call vcard_information_window class to display user's information'''
|
'''Call vcard_information_window class to display user's information'''
|
||||||
|
|
Loading…
Reference in New Issue