8 - UserInfo runs the callback with 'nil' instead of the documented behavior for offline users.
What steps will reproduce the problem?
1. Embed the library per the documentation.
2. Call self:UserInfo('SomeoneNotOnline', {callback='handleUserData'})
3. handleUserData will get called with nil as the first parameter.
What is the expected output? What do you see instead?
I'm expecting something along the lines of
{ Name='SomeoneNotOnline', Online=false }
What version of the product are you using?
2.0-2.0.2
Do you have an error log of what happened?
Not one that's very useful.
Please provide any additional information below.
This patch fixes the bug:
--- LibWho-2.0.lua.orig 2009-04-14 12:40:18.000000000 -0400
+++ LibWho-2.0.lua 2009-05-04 00:47:31.000000000 -0400
@@ -178,7 +178,7 @@
self:RaiseCallback(args, self.Cache[args.name].data)
return false
else
- return self:DupAll(self:ReturnUserInfo(name))
+ return self:DupAll(self:ReturnUserInfo(args.name))
end
elseif(self.Cache[args.name].valid == false)then
-- query is already running (first try)
@@ -426,7 +426,7 @@
end
dbg('Info(' .. name ..') returned: ' .. (self.Cache[name].data.Online == false and 'off' or 'unkn'))
for _,v in pairs(self.Cache[name].callback) do
- self:RaiseCallback(v, self:ReturnUserInfo(v.Name))
+ self:RaiseCallback(v, self:ReturnUserInfo(v.name))
end
self.Cache[name].callback = {}
self.CacheQueue[self.Args.query] = nil
Thanks for a great library, by the way. It has saved me a lot of time :)- 2 comments
- 2 comments
- Reply
- #2
sylvanaar Aug 03, 2009 at 00:09 UTC - 0 likesThe code has changed a bit. Could you review this issue, and the change I made to correct it?
- Reply
- #1
sylvanaar Aug 03, 2009 at 00:08 UTC - 0 likesRevision: 90 Author: sylvanaar Date: 8:07:32 PM, Sunday, August 02, 2009 Message: Part of the suggested fix for #8. The fix for the missing table reference was added, but the case change for v.Name still needs clarification
Modified : /trunk/LibWho-2.0/LibWho-2.0.lua