diff --git a/pyweb/mumble/mmobjects.py b/pyweb/mumble/mmobjects.py index 024f324..30df4ce 100755 --- a/pyweb/mumble/mmobjects.py +++ b/pyweb/mumble/mmobjects.py @@ -21,7 +21,7 @@ from time import time from os.path import join from django.utils.http import urlquote - +from django.conf import settings def cmp_names( a, b ): return cmp( a.name, b.name ); @@ -102,9 +102,12 @@ class mmChannel( object ): # create a path by joining the channel names chanpath = join( *chanlist ); - return "mumble://%s%s:%d/%s" % ( userstr, self.server.addr, self.server.port, chanpath ); + if self.server.port != settings.MUMBLE_DEFAULT_PORT: + return "mumble://%s%s:%d/%s" % ( userstr, self.server.addr, self.server.port, chanpath ); + + return "mumble://%s%s/%s" % ( userstr, self.server.addr, chanpath ); - url = property( getURL, None ); + connecturl = property( getURL, None ); diff --git a/pyweb/mumble/models.py b/pyweb/mumble/models.py index ff41f4b..714a5fd 100755 --- a/pyweb/mumble/models.py +++ b/pyweb/mumble/models.py @@ -111,7 +111,7 @@ class Mumble( models.Model ): self.ctl.setConf( self.srvid, 'bandwidth', '' ); # registerHostname needs to take the port no into account - if self.port and self.port != 64738: + if self.port and self.port != settings.MUMBLE_DEFAULT_PORT: self.ctl.setConf( self.srvid, 'registerhostname', "%s:%d" % ( self.addr, self.port ) ); else: self.ctl.setConf( self.srvid, 'registerhostname', self.addr ); @@ -211,9 +211,12 @@ class Mumble( models.Model ): if forUser is not None: userstr = "%s@" % forUser.name; - return "mumble://%s%s:%d/" % ( userstr, self.addr, self.port ); + if self.port != settings.MUMBLE_DEFAULT_PORT: + return "mumble://%s%s:%d/" % ( userstr, self.addr, self.port ); + + return "mumble://%s%s/" % ( userstr, self.addr ); - url = property( getURL, None ); + connecturl = property( getURL, None ); diff --git a/pyweb/settings.py b/pyweb/settings.py index 854f403..b98d8a5 100755 --- a/pyweb/settings.py +++ b/pyweb/settings.py @@ -44,9 +44,9 @@ MUMBLE_DJANGO_ROOT = None; ## # Default email address to send mails from. DEFAULT_FROM_EMAIL = "webmaster@localhost" - ACCOUNT_ACTIVATION_DAYS = 30 +MUMBLE_DEFAULT_PORT = 64738 from os.path import join, dirname, abspath, exists