Changeset

1495:9a1b3f0d0939

mod_webpresence: fixed render-type handling (thanks to biszkopcik and Zash)
author Vadim Misbakh-Soloviov <mva@mva.name>
date Mon, 25 Aug 2014 23:58:50 +0700
parents 1494:02cd4a081db4
children 1496:cccb151a4cc5
files mod_webpresence/mod_webpresence.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_webpresence/mod_webpresence.lua	Mon Aug 25 12:03:52 2014 +0100
+++ b/mod_webpresence/mod_webpresence.lua	Mon Aug 25 23:58:50 2014 +0700
@@ -47,7 +47,6 @@
     end
   end
   status = status or "offline";
-  if type == "" then type = "image" end;
 
   statuses[status].image = function()
     return { status_code = 200, headers = { content_type = "image/png" },
@@ -103,6 +102,11 @@
         )
       };
   end
+
+  if ((type == "") or (not statuses[status][type])) then
+    type = "image"
+  end;
+
   return statuses[status][type]();
 end