aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/purkle
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-01-03 00:06:41 +1000
committerDavid Walter Seikel2016-01-03 00:06:41 +1000
commitd7bc357b2d1ec596e1b7fc982d0e299db3b4135c (patch)
treec429506e16efc4df624c12086c60cc47a2e9e069 /src/purkle
parentRejig the build, test, and kill scripts a little bit. (diff)
downloadSledjHamr-d7bc357b2d1ec596e1b7fc982d0e299db3b4135c.zip
SledjHamr-d7bc357b2d1ec596e1b7fc982d0e299db3b4135c.tar.gz
SledjHamr-d7bc357b2d1ec596e1b7fc982d0e299db3b4135c.tar.bz2
SledjHamr-d7bc357b2d1ec596e1b7fc982d0e299db3b4135c.tar.xz
Beat the server connection manegement into shape.
Diffstat (limited to '')
-rw-r--r--src/purkle/purkle.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/purkle/purkle.c b/src/purkle/purkle.c
index d00fd67..9a21700 100644
--- a/src/purkle/purkle.c
+++ b/src/purkle/purkle.c
@@ -49,17 +49,14 @@ static int say(lua_State *L)
49 if (id && text) 49 if (id && text)
50 { 50 {
51 GuiLua *gl; 51 GuiLua *gl;
52 Ecore_Con_Server *server = NULL;
53 52
54 snprintf(buf, sizeof(buf), "events.listen(%d, '%s', '%s', '%s')", channel, name, id, text); 53 snprintf(buf, sizeof(buf), "events.listen(%d, '%s', '%s', '%s')", channel, name, id, text);
55 // We do this rather than caching it, coz the server might change out from under us. 54 // We do this rather than caching it, coz the server might change out from under us.
56 lua_getfield(L, LUA_REGISTRYINDEX, glName); 55 lua_getfield(L, LUA_REGISTRYINDEX, glName);
57 gl = lua_touserdata(L, -1); 56 gl = lua_touserdata(L, -1);
58 lua_pop(L, 1); 57 lua_pop(L, 1);
59 if (gl) 58 if (gl && gl->server)
60 server = gl->server; 59 sendForth(gl->server, id, buf);
61 if (server)
62 sendForth(server, id, buf);
63 else 60 else
64 PW("PURKLE NOT SAY, no where to send %s", buf); 61 PW("PURKLE NOT SAY, no where to send %s", buf);
65 } 62 }