Browse Source

channel list will be created correctly even if ICE returns children before their parents

Natenom/support-murmur-13-1446181288462
Michael Ziegler 16 years ago
parent
commit
2dfd02baba
  1. 13
      pyweb/mumble/mmobjects.py

13
pyweb/mumble/mmobjects.py

@ -40,14 +40,23 @@ class mmServer( object ):
links = dict(); links = dict();
for theChan in ctl.getChannels(model.srvid):
chanlist = ctl.getChannels(model.srvid);
# sometimes, ICE seems to return the Channel list in a weird order.
while len(chanlist):
#print len(chanlist)
for theChan in chanlist:
# Channels - Fields: 0 = ID, 1 = Name, 2 = Parent-ID, 3 = Links # Channels - Fields: 0 = ID, 1 = Name, 2 = Parent-ID, 3 = Links
if( theChan[2] == -1 ): if( theChan[2] == -1 ):
# No parent # No parent
self.channels[theChan[0]] = mmChannel( theChan ); self.channels[theChan[0]] = mmChannel( theChan );
else:
elif theChan[2] in self.channels:
# parent already known
self.channels[theChan[0]] = mmChannel( theChan, self.channels[theChan[2]] ); self.channels[theChan[0]] = mmChannel( theChan, self.channels[theChan[2]] );
else:
continue;
chanlist.remove( theChan );
self.channels[theChan[0]].serverId = self.id; self.channels[theChan[0]].serverId = self.id;

Loading…
Cancel
Save