mod_presence: Tag outgoing unavailables generated by a disconnect with a from attribute
[prosody.git] / util / array.lua
index 8b9102bf13da9ec8f08c5310a61350733e6e7199..ce5ce07747f1685573291e6973254f39d0848b50 100644 (file)
@@ -1,3 +1,11 @@
+-- Prosody IM
+-- Copyright (C) 2008-2009 Matthew Wild
+-- Copyright (C) 2008-2009 Waqas Hussain
+-- 
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
 local array = {};
 
 local array_mt = { __index = array, __tostring = function (array) return array:concat(", "); end };
@@ -5,6 +13,11 @@ local function new_array(_, t)
        return setmetatable(t or {}, array_mt);
 end
 
+function array_mt.__add(a1, a2)
+       local res = new_array();
+       return res:append(a1):append(a2);
+end
+
 setmetatable(array, { __call = new_array });
 
 function array:map(func, t2)