Branching buddy code
authorMyhailo Danylenko <isbear@ukrpost.net>
Fri, 27 Feb 2009 21:57:56 +0200
changeset 11 f74fff438888
parent 10 73f4c12b6ffb
child 12 a52d61f57e0d
Branching buddy code
TODO
main.c
--- a/TODO	Fri Feb 27 00:19:33 2009 +0200
+++ b/TODO	Fri Feb 27 21:57:56 2009 +0200
@@ -8,4 +8,5 @@
 help system accessors (needs major rewrite and planning)
 object access to roster and buddies
 there are many places with code, that really works only in utf
+in mcabber add hook/call to also handle room status changes
 
--- a/main.c	Fri Feb 27 00:19:33 2009 +0200
+++ b/main.c	Fri Feb 27 21:57:56 2009 +0200
@@ -639,27 +639,6 @@
 	return 0;
 }
 
-// BUDDY
-
-#if 0
-static int lua_buddy_name (lua_State *L)
-{
-	lua_buddy_t *buddy = luaL_checkbuddy (L, 1);
-	if (lua_gettop (L) > 1) { // Set
-		const char *name = luaL_checkstring (L, 2);
-		buddy_setname (buddy->obj, name);
-		return 0;
-	} else { // Get
-		const char *name = buddy_getname (buddy->obj);
-		if (name)
-			lua_pushstring (L, name);
-		else
-			lua_pushnil (L);
-		return 1;
-	}
-}
-#endif
-
 // MAIN INITIALIZATION CODE
 
 #ifdef LLM_LOG_HANDLER
@@ -745,46 +724,6 @@
 };
 #undef reg
 
-#if 0
-#define reg(name)                    \
-	{ #NAME, lua_buddy_##NAME },
-static const luaL_Reg lua_reg_buddy[] = {
-	reg ( jid )
-	reg ( group )
-	reg ( name )
-	reg ( nick )
-	reg ( in_room )
-	reg ( topic )
-	reg ( printstatus )
-	reg ( autowhois )
-	reg ( type )
-	reg ( subscription )
-	reg ( status )
-	reg ( message )
-	reg ( time )
-	reg ( priority )
-	reg ( events )
-	reg ( caps )
-	reg ( role )
-	reg ( realjid )
-	reg ( flags )
-	reg ( onserver )
-	reg ( resources )
-	{ "__gc", lua_buddy_gc },
-	{ NULL,   NULL         },
-};
-#undef reg
-#endif
-
-#if 0
-static const luaL_Reg lua_reg_roster[] = {
-	{ "__index",    lua_roster_index    },
-	{ "__newindex", lua_roster_newindex },
-	{ "__len",      lua_roster_len      },
-	{ NULL,         NULL                },
-};
-#endif
-
 const gchar *g_module_check_init (GModule *module)
 {
 	lua = lua_newstate (lua_alloc, NULL);
@@ -800,19 +739,7 @@
 	lua_register (lua, "dopath", lua_global_dopath);
 	lua_register (lua, "print",  lua_global_print );
 
-#if 0
-	lua_newtable (lua);
-	luaL_newmetatable (lua, "mcabber.roster");
-	luaL_register (lua, NULL, lua_reg_roster);
-	lua_setmetatable (lua, -2);
-	lua_setglobal (lua, "roster");
-
-	lua_newuserdata (lua,1);
-	luaL_newmetatable (lua, "mcabber.buddy");
-	luaL_register (lua, NULL, lua_reg_buddy);
-#endif
-
-	cmd_add ("lua", "", 0, 0, (void (*) (char *p)) do_lua, lua);
+	cmd_add ("lua", "Evaluate lua string", 0, 0, (void (*) (char *p)) do_lua, lua);
 
 #ifdef LLM_LOG_HANDLER
 	// FIXME: this should not be here.