]> code.delx.au - pulseaudio/blobdiff - polyp/module-x11-publish.c
Make the whole stuff LGPL only
[pulseaudio] / polyp / module-x11-publish.c
index 6e100153f4c0b1347cab26c28ff576d1a9d6a826..acf3775978ca30a1dcc43b615fa15acc8e055783 100644 (file)
@@ -4,7 +4,7 @@
   This file is part of polypaudio.
  
   polypaudio is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published
+  it under the terms of the GNU Lesser General Public License as published
   by the Free Software Foundation; either version 2 of the License,
   or (at your option) any later version.
  
@@ -13,7 +13,7 @@
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.
  
-  You should have received a copy of the GNU General Public License
+  You should have received a copy of the GNU Lesser General Public License
   along with polypaudio; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
   USA.
@@ -46,6 +46,8 @@
 #include "authkey-prop.h"
 #include "authkey.h"
 #include "x11prop.h"
+#include "strlist.h"
+#include "props.h"
 
 PA_MODULE_AUTHOR("Lennart Poettering")
 PA_MODULE_DESCRIPTION("X11 Credential Publisher")
@@ -101,6 +103,8 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
     char hn[256], un[128];
     char hx[PA_NATIVE_COOKIE_LENGTH*2+1];
     const char *t;
+    char *s;
+    struct pa_strlist *l;
 
     if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
         pa_log(__FILE__": failed to parse module arguments\n");
@@ -120,15 +124,17 @@ int pa__init(struct pa_core *c, struct pa_module*m) {
 
     u->display = pa_x11_wrapper_get_display(u->x11_wrapper);
 
-    if (!pa_get_fqdn(hn, sizeof(hn)))
+    if (!(l = pa_property_get(c, PA_NATIVE_SERVER_PROPERTY_NAME)))
         goto fail;
+
+    s = pa_strlist_tostring(l);
+    pa_x11_set_prop(u->display, "POLYP_SERVER", s);
+    pa_xfree(s);
     
-    if (!pa_get_user_name(un, sizeof(un)))
+    if (!pa_get_fqdn(hn, sizeof(hn)) || !pa_get_user_name(un, sizeof(un)))
         goto fail;
     
     u->id = pa_sprintf_malloc("%s@%s/%u", un, hn, (unsigned) getpid());
-
-    pa_x11_set_prop(u->display, "POLYP_SERVER", hn);
     pa_x11_set_prop(u->display, "POLYP_ID", u->id);
 
     if ((t = pa_modargs_get_value(ma, "source", NULL)))