diff options
Diffstat (limited to 'Sluift/client.cpp')
| -rw-r--r-- | Sluift/client.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Sluift/client.cpp b/Sluift/client.cpp index ec208bc..24ece85 100644 --- a/Sluift/client.cpp +++ b/Sluift/client.cpp @@ -593,18 +593,45 @@ static void pushEvent(lua_State* L, const SluiftClient::Event& event) { } case SluiftClient::Event::UnblockEventType: { Lua::Table result = boost::assign::map_list_of ("type", std::make_shared<Lua::Value>(std::string("unblock"))) ("jid", std::make_shared<Lua::Value>(event.item.toString())); Lua::pushValue(L, result); Lua::registerTableToString(L, -1); break; } + case SluiftClient::Event::RosterAddType: { + Lua::Table result = boost::assign::map_list_of + ("type", std::make_shared<Lua::Value>(std::string("rosterpush"))) + ("jid", std::make_shared<Lua::Value>(event.item.toString())) + ("action", std::make_shared<Lua::Value>(std::string("added"))); + Lua::pushValue(L, result); + Lua::registerTableToString(L, -1); + break; + } + case SluiftClient::Event::RosterRemoveType: { + Lua::Table result = boost::assign::map_list_of + ("type", std::make_shared<Lua::Value>(std::string("rosterpush"))) + ("jid", std::make_shared<Lua::Value>(event.item.toString())) + ("action", std::make_shared<Lua::Value>(std::string("removed"))); + Lua::pushValue(L, result); + Lua::registerTableToString(L, -1); + break; + } + case SluiftClient::Event::RosterUpdateType: { + Lua::Table result = boost::assign::map_list_of + ("type", std::make_shared<Lua::Value>(std::string("rosterpush"))) + ("jid", std::make_shared<Lua::Value>(event.item.toString())) + ("action", std::make_shared<Lua::Value>(std::string("updated"))); + Lua::pushValue(L, result); + Lua::registerTableToString(L, -1); + break; + } } } struct CallUnaryLuaPredicateOnEvent { CallUnaryLuaPredicateOnEvent(lua_State* L, int index) : L(L), index(index) { } bool operator()(const SluiftClient::Event& event) { lua_pushvalue(L, index); |
Swift