aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/purkle/purkle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/purkle/purkle.c')
-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 }