Observersa in also a special group than can't be renamed / can't reveive contacts with DND
This commit is contained in:
parent
204f8b89f3
commit
66a4f406fa
|
@ -122,6 +122,7 @@ status_before_autoaway = {}
|
||||||
|
|
||||||
SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
|
SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
|
||||||
'invisible']
|
'invisible']
|
||||||
|
special_groups = (_('Transports'), _('Not in Roster'), _('Observers'))
|
||||||
|
|
||||||
def get_nick_from_jid(jid):
|
def get_nick_from_jid(jid):
|
||||||
pos = jid.find('@')
|
pos = jid.find('@')
|
||||||
|
|
|
@ -158,7 +158,7 @@ class EditGroupsDialog:
|
||||||
store = gtk.ListStore(str, bool)
|
store = gtk.ListStore(str, bool)
|
||||||
self.list.set_model(store)
|
self.list.set_model(store)
|
||||||
for g in gajim.groups[self.account].keys():
|
for g in gajim.groups[self.account].keys():
|
||||||
if g in (_('Transports'), _('Not in Roster')):
|
if g in gajim.special_groups:
|
||||||
continue
|
continue
|
||||||
iter = store.append()
|
iter = store.append()
|
||||||
store.set(iter, 0, g)
|
store.set(iter, 0, g)
|
||||||
|
@ -416,7 +416,7 @@ _('Please fill in the data of the contact you want to add in account %s') %accou
|
||||||
liststore = gtk.ListStore(str)
|
liststore = gtk.ListStore(str)
|
||||||
self.group_comboboxentry.set_model(liststore)
|
self.group_comboboxentry.set_model(liststore)
|
||||||
for g in gajim.groups[account].keys():
|
for g in gajim.groups[account].keys():
|
||||||
if g != _('Not in Roster') and g != _('Transports'):
|
if g not in gajim.special_groups:
|
||||||
self.group_comboboxentry.append_text(g)
|
self.group_comboboxentry.append_text(g)
|
||||||
|
|
||||||
if not jid_agents:
|
if not jid_agents:
|
||||||
|
|
|
@ -2523,10 +2523,9 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
elif type == 'group':
|
elif type == 'group':
|
||||||
# in C_JID column, we hold the group name (which is not escaped)
|
# in C_JID column, we hold the group name (which is not escaped)
|
||||||
old_name = model[iter][C_JID].decode('utf-8')
|
old_name = model[iter][C_JID].decode('utf-8')
|
||||||
# Groups may not change name from or to 'Not in Roster' nor Transports
|
# Groups may not change name from or to a special groups
|
||||||
if _('Not in Roster') in (new_text, old_name):
|
for g in gajim.special_groups:
|
||||||
return
|
if g in (new_text, old_name):
|
||||||
if _('Transports') in (new_text, old_name):
|
|
||||||
return
|
return
|
||||||
# get all contacts in that group
|
# get all contacts in that group
|
||||||
for jid in gajim.contacts.get_jid_list(account):
|
for jid in gajim.contacts.get_jid_list(account):
|
||||||
|
@ -2991,7 +2990,7 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
it = model.iter_parent(it)
|
it = model.iter_parent(it)
|
||||||
iter_group_source = it
|
iter_group_source = it
|
||||||
grp_source = model[it][C_JID].decode('utf-8')
|
grp_source = model[it][C_JID].decode('utf-8')
|
||||||
if grp_source == _('Transports') or grp_source == _('Not in Roster'):
|
if grp_source in gajim.special_groups:
|
||||||
return
|
return
|
||||||
jid_source = data.decode('utf-8')
|
jid_source = data.decode('utf-8')
|
||||||
c_source = gajim.contacts.get_contact_with_highest_priority(account,
|
c_source = gajim.contacts.get_contact_with_highest_priority(account,
|
||||||
|
@ -2999,7 +2998,7 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
# Get destination group
|
# Get destination group
|
||||||
if type_dest == 'group':
|
if type_dest == 'group':
|
||||||
grp_dest = model[iter_dest][C_JID].decode('utf-8')
|
grp_dest = model[iter_dest][C_JID].decode('utf-8')
|
||||||
if grp_dest == _('Transports') or grp_dest == _('Not in Roster'):
|
if grp_dest in gajim.special_groups:
|
||||||
return
|
return
|
||||||
if context.action == gtk.gdk.ACTION_COPY:
|
if context.action == gtk.gdk.ACTION_COPY:
|
||||||
self.on_drop_in_group(None, account, c_source, grp_dest, context,
|
self.on_drop_in_group(None, account, c_source, grp_dest, context,
|
||||||
|
@ -3013,7 +3012,7 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
while model[it][C_TYPE] != 'group':
|
while model[it][C_TYPE] != 'group':
|
||||||
it = model.iter_parent(it)
|
it = model.iter_parent(it)
|
||||||
grp_dest = model[it][C_JID].decode('utf-8')
|
grp_dest = model[it][C_JID].decode('utf-8')
|
||||||
if grp_dest == _('Transports') or grp_dest == _('Not in Roster'):
|
if grp_dest in gajim.special_groups:
|
||||||
return
|
return
|
||||||
if jid_source == jid_dest:
|
if jid_source == jid_dest:
|
||||||
if grp_source == grp_dest:
|
if grp_source == grp_dest:
|
||||||
|
|
Loading…
Reference in New Issue