about summary refs log tree commit diff stats
path: root/apidocs
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2017-01-21 20:23:28 +0000
committerJames Booth <boothj5@gmail.com>2017-01-21 20:23:28 +0000
commit7090f85d853b32ac6799bdc5641cd81502ff65dc (patch)
treed1868c5f1f502a10753f702837ac8a48a2bc2832 /apidocs
parent9cfd17821c427ae2c129842b5f626fbdb3a73a67 (diff)
downloadprofani-tty-7090f85d853b32ac6799bdc5641cd81502ff65dc.tar.gz
Add chat and room show calls to plugins api
Diffstat (limited to 'apidocs')
-rw-r--r--apidocs/c/profapi.h50
-rw-r--r--apidocs/python/src/prof.py90
2 files changed, 134 insertions, 6 deletions
diff --git a/apidocs/c/profapi.h b/apidocs/c/profapi.h
index fd872dd1..a1578739 100644
--- a/apidocs/c/profapi.h
+++ b/apidocs/c/profapi.h
@@ -23,16 +23,16 @@ typedef void(*WINDOW_CB)(PROF_WIN_TAG win, char *line);
 /**	Highlights the console window in the status bar. */
 void prof_cons_alert(void);
 
-/**	
+/**
 Show a message in the console window.
 @param message the message to print
 @return 1 on success, 0 on failure
 */
 int prof_cons_show(const char * const message);
 
-/**	
+/**
 Show a message in the console, using the specified theme.
-Themes can be must be specified in ~/.local/share/profanity/plugin_themes
+Themes are specified in ~/.local/share/profanity/plugin_themes
 @param group the group name in the themes file
 @param item the item name within the group
 @param def default colour if the theme cannot be found
@@ -206,7 +206,7 @@ int prof_win_show(PROF_WIN_TAG win, char *message);
 
 /**	
 Show a message in the plugin window, using the specified theme.
-Themes must be specified in ~/.local/share/profanity/plugin_themes
+Themes are specified in ~/.local/share/profanity/plugin_themes
 @param tag The {@link PROF_WIN_TAG} of the window to display the message
 @param group the group name in the themes file
 @param key the item name within the group
@@ -414,3 +414,45 @@ Reset the message prefix character for specified room.
 @return 1 on success, 0 on failure
 */
 int prof_room_unset_message_char(char *roomjid);
+
+/**
+Show a message in a chat window.
+@param barejid Jabber ID of the recipient
+@param message the message to print
+@return 1 on success, 0 on failure
+*/
+int prof_chat_show(char *barejid, char *message);
+
+/**
+Show a message in a chat window, using the specified theme, and prefix character
+Themes are specified in ~/.local/share/profanity/plugin_themes
+@param barejid Jabber ID of the recipient
+@param group the group name in the themes file or NULL
+@param item the item name within the group or NULL
+@param def default colour if the theme cannot be found
+@param ch The character to prefix the message, or NULL for default behaviour
+@param message the message to print
+@return 1 on success, 0 on failure
+*/
+int prof_chat_show_themed(char *barejid, char *group, char *item, char *def, char *ch, char *message);
+
+/**
+Show a message in a chat room window.
+@param barejid Jabber ID of the room
+@param message the message to print
+@return 1 on success, 0 on failure
+*/
+int prof_room_show(char *roomjid, char *message);
+
+/**
+Show a message in a chat room window, using the specified theme, and prefix character
+Themes are specified in ~/.local/share/profanity/plugin_themes
+@param barejid Jabber ID of the room
+@param group the group name in the themes file or NULL
+@param item the item name within the group or NULL
+@param def default colour if the theme cannot be found
+@param ch The character to prefix the message, or NULL for default behaviour
+@param message the message to print
+@return 1 on success, 0 on failure
+*/
+int prof_room_show_themed(char *roomjid, char *group, char *item, char *def, char *ch, char *message);
diff --git a/apidocs/python/src/prof.py b/apidocs/python/src/prof.py
index 35981473..6c80e2f2 100644
--- a/apidocs/python/src/prof.py
+++ b/apidocs/python/src/prof.py
@@ -31,7 +31,7 @@ def cons_show(message):
 
 def cons_show_themed(group, key, default, message): 
     """Show a message in the console, using the specified theme.\n
-    Themes can be must be specified in ``~/.local/share/profanity/plugin_themes``
+    Themes are specified in ``~/.local/share/profanity/plugin_themes``
 
     :param group: the group name in the themes file
     :param key: the item name within the group
@@ -376,7 +376,7 @@ def win_show(tag, message):
 
 def win_show_themed(tag, group, key, default, message): 
     """Show a message in the plugin window, using the specified theme.\n
-    Themes must be specified in ``~/.local/share/profanity/plugin_themes``
+    Themes are specified in ``~/.local/share/profanity/plugin_themes``
 
     :param tag: The tag of the window to display the message
     :type tag: str or unicode
@@ -797,3 +797,89 @@ def room_unset_message_char(roomjid):
         prof.room_unset_message_char("ohnoes@conference.chat.org")
     """
     pass
+
+
+def chat_show(barejid, message):
+    """Show a message in a chat window.
+
+    :param barejid: Jabber ID of the recipient
+    :param message: the message to print
+    :type barejid: str or unicode
+    :type message: str or unicode
+    :return: ``True`` if the message was printed, ``False`` otherwise
+    :rtype: boolean
+
+    Example:
+    ::
+        prof.chat_show("bob@server.org", "From a plugin in the chat window for bob")
+    """
+    pass
+
+
+def chat_show_themed(barejid, group, key, default, ch, message):
+    """Show a message a chat window, using the specified theme and prefix character.\n
+    Themes are specified in ``~/.local/share/profanity/plugin_themes``
+
+    :param barejid: Jabber ID of the recipient
+    :param group: the group name in the themes file or ``None``
+    :param key: the item name within the group or ``None``
+    :param default: default colour if the theme cannot be found or ``None``
+    :param ch: The prefix character to show, or ``None`` for default behaviour
+    :param message: the message to print
+    :type barejid: str or unicode
+    :type group: str, unicode or None
+    :type key: str, unicode or None
+    :type default: str, unicode or None
+    :type ch: str or unicode
+    :type message: str or unicode
+    :return: ``True`` if the message was printed, ``False`` otherwise
+    :rtype: boolean
+
+    Example:
+    ::
+        prof.chat_show_themed("bob@server.org", "myplugin", "text", None, "!", "Plugin themed message")
+    """
+    pass
+
+
+def room_show(roomjid, message):
+    """Show a message in a chat room window.
+
+    :param roomjid: Jabber ID of the room
+    :param message: the message to print
+    :type roomjid: str or unicode
+    :type message: str or unicode
+    :return: ``True`` if the message was printed, ``False`` otherwise
+    :rtype: boolean
+
+    Example:
+    ::
+        prof.room_show("chat@conference.chat.org", "From a plugin in the chat room window")
+    """
+    pass
+
+
+def room_show_themed(roomjid, group, key, default, ch, message):
+    """Show a message a chat room window, using the specified theme and prefix character.\n
+    Themes are specified in ``~/.local/share/profanity/plugin_themes``
+
+    :param roomjid: Jabber ID of the room
+    :param group: the group name in the themes file or ``None``
+    :param key: the item name within the group or ``None``
+    :param default: default colour if the theme cannot be found or ``None``
+    :param ch: The prefix character to show, or ``None`` for default behaviour
+    :param message: the message to print
+    :type roomjid: str or unicode
+    :type group: str, unicode or None
+    :type key: str, unicode or None
+    :type default: str, unicode or None
+    :type ch: str or unicode
+    :type message: str or unicode
+    :return: ``True`` if the message was printed, ``False`` otherwise
+    :rtype: boolean
+
+    Example:
+    ::
+        prof.room_show_themed("chat@conference.chat.org", "myplugin", "text", None, "!", "Plugin themed message")
+    """
+    pass