diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-03-05 10:59:25 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-03-05 10:59:25 (GMT) |
commit | f19d2718149f36fa017c64ad95a7fb3ce045347c (patch) | |
tree | f132aecf03fec599b77a1028adfd042e3fae887d /Sluift | |
parent | 3cc102d61a883b4d76662f8e4e53d10142f061e0 (diff) | |
download | swift-f19d2718149f36fa017c64ad95a7fb3ce045347c.zip swift-f19d2718149f36fa017c64ad95a7fb3ce045347c.tar.bz2 |
Sluift: roster->contacts
Diffstat (limited to 'Sluift')
-rw-r--r-- | Sluift/sluift.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<Lua::Value>(item.getName())) ("subscription", boost::make_shared<Lua::Value>(subscription)) ("groups", boost::make_shared<Lua::Value>(std::vector<Lua::Value>(item.getGroups().begin(), item.getGroups().end()))); - rosterTable[item.getJID().toString()] = boost::make_shared<Lua::Value>(itemTable); + contactsTable[item.getJID().toString()] = boost::make_shared<Lua::Value>(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}, |