Browse Source

Now the links in the channel viewer work correctly

Natenom/support-murmur-13-1446181288462
root 16 years ago
parent
commit
fab9cf879a
  1. 2
      pyweb/mumble/admin.py
  2. 25
      pyweb/mumble/mmobjects.py
  3. 2
      pyweb/mumble/models.py
  4. 2
      pyweb/mumble/views.py

2
pyweb/mumble/admin.py

@ -1,6 +1,6 @@
""" This file is part of the mumble-django application.
Copyright (C) 2009, Michael Svedrin Ziegler <diese-addy@funzt-halt.net>
Copyright (C) 2009, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
All rights reserved.

25
pyweb/mumble/mmobjects.py

@ -1,6 +1,6 @@
""" This file is part of the mumble-django application.
Copyright (C) 2009, Michael Svedrin Ziegler <diese-addy@funzt-halt.net>
Copyright (C) 2009, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
All rights reserved.
@ -94,6 +94,13 @@ class mmServer( object ):
None
);
def is_server( self ):
return True;
def is_channel( self ):
return False;
def is_player( self ):
return False;
def __str__( self ):
return '<Server "%s" (%d)>' % ( self.rootName, self.id );
@ -127,10 +134,17 @@ class mmChannel( object ):
self.parent.subchans.append( self );
def parentChannels( self ):
if self.parent is None or isinstance( self.parent, mmServer ):
if self.parent is None or self.parent.is_server() or self.parent.id == 0:
return [];
return self.parent.parentChannels() + [self.parent.name];
def is_server( self ):
return False;
def is_channel( self ):
return True;
def is_player( self ):
return False;
playerCount = property(
lambda self: len( self.players ) + sum( [ chan.playerCount for chan in self.subchans ] ),
None
@ -175,6 +189,13 @@ class mmPlayer( object ):
def isAuthed( self ):
return self.dbaseid != -1;
def is_server( self ):
return False;
def is_channel( self ):
return False;
def is_player( self ):
return True;
# kept for compatibility to mmChannel (useful for traversal funcs)
playerCount = property(
lambda self: -1,

2
pyweb/mumble/models.py

@ -1,6 +1,6 @@
""" This file is part of the mumble-django application.
Copyright (C) 2009, Michael Svedrin Ziegler <diese-addy@funzt-halt.net>
Copyright (C) 2009, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
All rights reserved.

2
pyweb/mumble/views.py

@ -1,6 +1,6 @@
""" This file is part of the mumble-django application.
Copyright (C) 2009, Michael Svedrin Ziegler <diese-addy@funzt-halt.net>
Copyright (C) 2009, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
All rights reserved.

Loading…
Cancel
Save