summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/QA/ScriptedTests/SendMessage.lua')
-rw-r--r--Swiften/QA/ScriptedTests/SendMessage.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/Swiften/QA/ScriptedTests/SendMessage.lua b/Swiften/QA/ScriptedTests/SendMessage.lua
index 8c54d00..9623ef4 100644
--- a/Swiften/QA/ScriptedTests/SendMessage.lua
+++ b/Swiften/QA/ScriptedTests/SendMessage.lua
@@ -1,5 +1,5 @@
--
--- Copyright (c) 2010 Remko Tronçon
+-- Copyright (c) 2010-2013 Remko Tronçon
-- Licensed under the GNU General Public License v3.
-- See Documentation/Licenses/GPLv3.txt for more information.
--
@@ -23,22 +23,22 @@ client2:send_presence("I'm here")
print "Checking version of client 2 from client 1"
client2:set_version({name = "Sluift Test", version = "1.0"})
-client2_version = client1:get_version(client2_jid)
+client2_version = client1:get_software_version {to=client2_jid}
assert(client2_version["name"] == "Sluift Test")
assert(client2_version["version"] == "1.0")
print "Sending message from client 1 to client 2"
client1:send_message(client2_jid, "Hello")
-received_message = client2:for_event(function(event)
- if event["type"] == "message" and event["from"] == client1_jid then
- return event["body"]
- end
- end, 10000)
+received_message = client2:for_each_message({timeout = 1000}, function(message)
+ if message["from"] == client1_jid then
+ return message["body"]
+ end
+end)
assert(received_message == "Hello")
print "Retrieving the roster"
roster = client1:get_roster()
-tprint(roster)
+sluift.tprint(roster)
client1:disconnect()
client2:disconnect()