[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/jami-bot 9d6c5c2ca9 07/12: make variables customizable
From: |
ELPA Syncer |
Subject: |
[elpa] externals/jami-bot 9d6c5c2ca9 07/12: make variables customizable |
Date: |
Tue, 30 Jan 2024 06:58:32 -0500 (EST) |
branch: externals/jami-bot
commit 9d6c5c2ca976daacdb2d3c4df856baa4be7798de
Author: Hanno Perrey <hanno@hoowl.se>
Commit: Hanno Perrey <hanno@hoowl.se>
make variables customizable
---
jami-bot.el | 42 +++++++++++++++++++++++++++++++-----------
1 file changed, 31 insertions(+), 11 deletions(-)
diff --git a/jami-bot.el b/jami-bot.el
index 61489b2eac..7461136ff0 100644
--- a/jami-bot.el
+++ b/jami-bot.el
@@ -48,38 +48,58 @@
(require 'dbus)
-(defvar jami-bot-account-user-names nil
+;;;; Customization
+
+(defgroup jami-bot nil
+ "Automatically process messages via GNU Jami."
+ :group 'comm)
+
+(defcustom jami-bot-account-user-names nil
"List of account user names that `jami-bot' handles messages for.
If set to nil then `jami-bot' will react to any message
send to a local account. The user name is also sometimes
referred to as address in Jami and should be a 40
character has such as
-\"badac18e13ec1a6e1266600e457859afebfb9c46\".")
-
-(defvar jami-bot-command-function-alist
'(("!ping" . jami-bot--command-function-ping)
("!help" . jami-bot--command-function-help))
+\"badac18e13ec1a6e1266600e457859afebfb9c46\"."
+ :group 'jami-bot
+ :type 'string)
+
+(defcustom jami-bot-command-function-alist
"Alist mapping command strings in message body to functions to be executed.
Each command needs to start with an exclamation mark '!' and
consist of a single (lowercase) word. The corresponding function needs to
accept the account id, the conversation id and the message alist as
-arguments and return a string (that is sent as reply to the original
message).")
+arguments and return a string (that is sent as reply to the original message)."
+ :group 'jami-bot
+ :type '(alist :key-type 'string :value-type 'function))
-(defvar jami-bot-text-message-functions nil
+(defcustom jami-bot-text-message-functions nil
"A list of functions that will be called when processing a plain text
message.
Functions must take the ACCOUNT and CONVERSATION ids as well as
-the actual MSG as arguments. Their return value will be ignored.")
- (defvar jami-bot-download-path "~/jami/"
+the actual MSG as arguments. Their return value will be ignored."
+ :group 'jami-bot
+ :type '(group 'function))
+
+
+(defcustom jami-bot-download-path "~/jami/"
"Path in which to store files downloaded from conversations.
-Will be created if not existing yet.")
+Will be created if not existing yet."
+ :group 'jami-bot
+ :type '(directory))
-(defvar jami-bot-data-transfer-functions nil
+(defcustom jami-bot-data-transfer-functions nil
"A list of functions that will be called when processing a data transfer
message.
Functions must take the ACCOUNT and CONVERSATION ids as well as
the actual MSG and the local downloaded file name, DLNAME, as
-arguments. Their return value will be ignored.")
+arguments. Their return value will be ignored."
+ :group 'jami-bot
+ :type '(group 'function))
+
+;; Internal variables
(defvar jami-bot--jami-local-account-ids nil
"List of `jami' local accounts user ids and name pairs.
- [elpa] branch externals/jami-bot created (now 4502fcfe8c), ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 63d7df8c5b 01/12: initial commit, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 8ee3d7d3ce 02/12: adds gitignore, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 21673c5844 03/12: fixes homepage adress, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 5d1a1f08b4 04/12: assign copyright to FSF, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 1da4d47158 09/12: fixes based on feedback by P. Kaludercic, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 4502fcfe8c 12/12: fix author's mail address, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot aa0dee230e 08/12: fix typo, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 9d6c5c2ca9 07/12: make variables customizable,
ELPA Syncer <=
- [elpa] externals/jami-bot 0f86171465 06/12: add .elpaignore, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 4f3e48b6d3 10/12: adds suggestions by P. Kaludercic, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 6823b52b3f 11/12: bump version number, ELPA Syncer, 2024/01/30
- [elpa] externals/jami-bot 349b3ab300 05/12: style changes, ELPA Syncer, 2024/01/30