diff libervia.tac @ 309:05e264e96a1c

browser_side: make unibox optional
author souliane <souliane@mailoo.org>
date Sun, 29 Dec 2013 23:07:28 +0100
parents 0ca441ba4317
children bbadd490e63c
line wrap: on
line diff
--- a/libervia.tac	Fri Dec 27 13:59:06 2013 +0100
+++ b/libervia.tac	Sun Dec 29 23:07:28 2013 +0100
@@ -243,6 +243,9 @@
         profile = ISATSession(self.session).profile
         extra['allow_comments'] = 'True'
 
+        if not type_:  # auto-detect
+            type_ = "PUBLIC" if dest == [] else "GROUP"
+
         if type_ in ("PUBLIC", "GROUP") and text:
             if type_ == "PUBLIC":
                 #This text if for the public microblog
@@ -508,7 +511,7 @@
         profile = ISATSession(self.session).profile
         self.sat_host.bridge.confirmationAnswer(confirmation_id, result, answer_data, profile)
 
-    def jsonrpc_syntaxConvert(self, text, syntax_from=Const._SYNTAX_XHTML, syntax_to=Const._SYNTAX_CURRENT):
+    def jsonrpc_syntaxConvert(self, text, syntax_from=Const.SYNTAX_XHTML, syntax_to=Const.SYNTAX_CURRENT):
         """ Convert a text between two syntaxes
         @param text: text to convert
         @param syntax_from: source syntax (e.g. "markdown")