From f19d2718149f36fa017c64ad95a7fb3ce045347c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sat, 5 Mar 2011 11:59:25 +0100 Subject: Sluift: roster->contacts diff --git a/Sluift/sluift.cpp b/Sluift/sluift.cpp index 5750dd2..ffadc38 100644 --- a/Sluift/sluift.cpp +++ b/Sluift/sluift.cpp @@ -245,12 +245,12 @@ static int sluift_client_set_version(lua_State *L) { } } -static int sluift_client_get_roster(lua_State *L) { +static int sluift_client_get_contacts(lua_State *L) { try { eventLoop.runUntilEvents(); SluiftClient* client = getClient(L); - Lua::Table rosterTable; + Lua::Table contactsTable; foreach(const XMPPRosterItem& item, client->getRoster()) { std::string subscription; switch(item.getSubscription()) { @@ -266,9 +266,9 @@ static int sluift_client_get_roster(lua_State *L) { ("name", boost::make_shared(item.getName())) ("subscription", boost::make_shared(subscription)) ("groups", boost::make_shared(std::vector(item.getGroups().begin(), item.getGroups().end()))); - rosterTable[item.getJID().toString()] = boost::make_shared(itemTable); + contactsTable[item.getJID().toString()] = boost::make_shared(itemTable); } - pushValue(L, rosterTable); + pushValue(L, contactsTable); return 1; } catch (const SluiftException& e) { @@ -597,7 +597,7 @@ static const luaL_reg sluift_client_functions[] = { {"set", sluift_client_set}, {"send", sluift_client_send}, {"set_version", sluift_client_set_version}, - {"get_roster", sluift_client_get_roster}, + {"get_contacts", sluift_client_get_contacts}, {"get_version", sluift_client_get_version}, {"set_options", sluift_client_set_options}, {"for_event", sluift_client_for_event}, -- cgit v0.10.2-6-g49f6