Browse Source

add ?version= tag to connect URLs

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
b2acbb0ce0
  1. 6
      pyweb/mumble/mmobjects.py
  2. 6
      pyweb/mumble/models.py

6
pyweb/mumble/mmobjects.py

@ -118,6 +118,8 @@ class mmChannel( object ):
if forUser is not None: if forUser is not None:
userstr = "%s@" % forUser.name; userstr = "%s@" % forUser.name;
versionstr = "version=%d.%d.%d" % self.server.version[0:3];
# create list of all my parents and myself # create list of all my parents and myself
chanlist = self.parentChannels() + [self.name]; chanlist = self.parentChannels() + [self.name];
# urlencode channel names # urlencode channel names
@ -126,9 +128,9 @@ class mmChannel( object ):
chanpath = join( *chanlist ); chanpath = join( *chanlist );
if self.server.port != settings.MUMBLE_DEFAULT_PORT: 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:%d/%s?%s" % ( userstr, self.server.addr, self.server.port, chanpath, versionstr );
return "mumble://%s%s/%s" % ( userstr, self.server.addr, chanpath );
return "mumble://%s%s/%s?%s" % ( userstr, self.server.addr, chanpath, versionstr );
connecturl = property( getURL, doc="A convenience wrapper for getURL." ); connecturl = property( getURL, doc="A convenience wrapper for getURL." );

6
pyweb/mumble/models.py

@ -351,10 +351,12 @@ class Mumble( models.Model ):
if forUser is not None: if forUser is not None:
userstr = "%s@" % forUser.name; userstr = "%s@" % forUser.name;
versionstr = "version=%d.%d.%d" % self.version[0:3];
if self.port != settings.MUMBLE_DEFAULT_PORT: if self.port != settings.MUMBLE_DEFAULT_PORT:
return "mumble://%s%s:%d/" % ( userstr, self.addr, self.port );
return "mumble://%s%s:%d/?%s" % ( userstr, self.addr, self.port, versionstr );
return "mumble://%s%s/" % ( userstr, self.addr );
return "mumble://%s%s/?%s" % ( userstr, self.addr, versionstr );
connecturl = property( getURL, doc="A convenience wrapper for getURL()." ); connecturl = property( getURL, doc="A convenience wrapper for getURL()." );

Loading…
Cancel
Save