equal
deleted
inserted
replaced
391 /// Note, that if there are no resources online, it will return just what it got. |
391 /// Note, that if there are no resources online, it will return just what it got. |
392 /// A: string (jid, optional) |
392 /// A: string (jid, optional) |
393 /// R: string (jid) |
393 /// R: string (jid) |
394 static int lua_main_full_jid (lua_State *L) |
394 static int lua_main_full_jid (lua_State *L) |
395 { |
395 { |
396 GList *buddy; |
396 GList *buddy; |
397 GSList *resources; |
397 GSList *resources; |
398 GSList *resource; |
398 GSList *resource; |
399 if (lua_gettop (L) > 0) { |
399 if (lua_gettop (L) > 0) { |
400 char *jid = from_utf8 (luaL_checkstring (L, 1)); |
400 char *jid = from_utf8 (luaL_checkstring (L, 1)); |
401 buddy = buddy_search_jid (jid); |
401 buddy = buddy_search_jid (jid); |
1024 } |
1024 } |
1025 } |
1025 } |
1026 |
1026 |
1027 static void lua_hook (hk_arg_t *args, lua_State *L) |
1027 static void lua_hook (hk_arg_t *args, lua_State *L) |
1028 { |
1028 { |
1029 hk_arg_t *arg = args; |
1029 hk_arg_t *arg = args; |
1030 const char *hook = settings_opt_get ("lua_hook_function"); |
1030 const char *hook = settings_opt_get ("lua_hook_function"); |
1031 if (!hook) |
1031 if (!hook) |
1032 return; |
1032 return; |
1033 lua_getglobal (lua, hook); |
1033 lua_getglobal (lua, hook); |
1034 if (!lua_isfunction (lua, -1)) { |
1034 if (!lua_isfunction (lua, -1)) { |
1061 } |
1061 } |
1062 |
1062 |
1063 #define reg(NAME) \ |
1063 #define reg(NAME) \ |
1064 { #NAME, lua_main_##NAME }, |
1064 { #NAME, lua_main_##NAME }, |
1065 static const luaL_Reg lua_reg_main[] = { |
1065 static const luaL_Reg lua_reg_main[] = { |
1066 reg ( yesno ) |
1066 reg ( yesno ) |
1067 reg ( connection ) |
1067 reg ( connection ) |
1068 reg ( log ) |
1068 reg ( log ) |
1069 reg ( option ) |
1069 reg ( option ) |
1070 reg ( alias ) |
1070 reg ( alias ) |
1071 reg ( binding ) |
1071 reg ( binding ) |
1072 reg ( fileoption ) |
1072 reg ( fileoption ) |
1073 reg ( add_feature ) |
1073 reg ( add_feature ) |
1074 reg ( del_feature ) |
1074 reg ( del_feature ) |
1075 reg ( parse_args ) |
1075 reg ( parse_args ) |
1076 reg ( add_category ) |
1076 reg ( add_category ) |
1077 reg ( del_category ) |
1077 reg ( del_category ) |
1078 reg ( add_completion ) |
1078 reg ( add_completion ) |
1079 reg ( del_completion ) |
1079 reg ( del_completion ) |
1080 reg ( command ) |
1080 reg ( command ) |
1081 reg ( print_info ) |
1081 reg ( print_info ) |
1082 reg ( beep ) |
1082 reg ( beep ) |
1083 reg ( run ) |
1083 reg ( run ) |
1084 reg ( status ) |
1084 reg ( status ) |
1085 reg ( roster ) |
1085 reg ( roster ) |
1086 reg ( current_buddy ) |
1086 reg ( current_buddy ) |
1087 reg ( full_jid ) |
1087 reg ( full_jid ) |
1088 reg ( buddy_info ) |
1088 reg ( buddy_info ) |
1089 reg ( timer ) |
1089 reg ( timer ) |
1090 reg ( bgread ) |
1090 reg ( bgread ) |
1091 { NULL, NULL }, |
1091 { NULL, NULL }, |
1092 }; |
1092 }; |
1093 #undef reg |
1093 #undef reg |
1094 |
1094 |
1095 const gchar *g_module_check_init (GModule *module) |
1095 const gchar *g_module_check_init (GModule *module) |