From 71a88c6d8c4578ca24e02a5c6f4860c206e7c6da Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 12 Jul 2015 13:45:28 +0000 Subject: oops git-svn-id: http://svn.miranda-ng.org/main/trunk@14542 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_database.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'plugins/MirLua/src/m_database.cpp') diff --git a/plugins/MirLua/src/m_database.cpp b/plugins/MirLua/src/m_database.cpp index 3f553c983f..8d05a605f3 100644 --- a/plugins/MirLua/src/m_database.cpp +++ b/plugins/MirLua/src/m_database.cpp @@ -291,7 +291,39 @@ static int SettingsChangedHookEventObjParam(void *obj, WPARAM wParam, LPARAM lPa lua_pushnumber(L, wParam); DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam; - + lua_newtable(L); + lua_pushstring(L, "Module"); + lua_pushstring(L, dbcws->szModule); + lua_settable(L, -3); + lua_pushstring(L, "Setting"); + lua_pushstring(L, dbcws->szSetting); + lua_settable(L, -3); + lua_pushstring(L, "Value"); + switch (dbcws->value.type) + { + case DBVT_BYTE: + lua_pushinteger(L, dbcws->value.bVal); + break; + case DBVT_WORD: + lua_pushinteger(L, dbcws->value.wVal); + break; + case DBVT_DWORD: + lua_pushnumber(L, dbcws->value.dVal); + break; + case DBVT_ASCIIZ: + lua_pushstring(L, ptrA(mir_utf8encode(dbcws->value.pszVal))); + break; + case DBVT_UTF8: + lua_pushstring(L, dbcws->value.pszVal); + break; + case DBVT_WCHAR: + lua_pushstring(L, ptrA(mir_utf8encodeW(dbcws->value.pwszVal))); + break; + default: + lua_pushvalue(L, 4); + return 1; + } + lua_settable(L, -3); if (lua_pcall(L, 2, 1, 0)) printf("%s\n", lua_tostring(L, -1)); -- cgit v1.2.3