]> crepu.dev Git - config.git/blob - djavu-asus/emacs/elpa/jabber-20230715.456/jabber.el
b3f9eda7d8adfc0472f3fa8c886f945790623c1e
[config.git] / djavu-asus / emacs / elpa / jabber-20230715.456 / jabber.el
1 ;;; jabber.el --- a minimal jabber client -*- lexical-binding: t; -*-
2
3 ;; Author: Magnus Henoch <mange@freemail.hu>
4 ;; Maintainer: wgreenhouse <wgreenhouse@tilde.club>
5 ;; Keywords: comm
6 ;; Homepage: https://codeberg.org/emacs-jabber/emacs-jabber
7 ;; Package-Requires: ((emacs "27.1") (fsm "0.1.0") (srv "0.1.0"))
8 ;; Version: 0.8.92
9
10 ;; Copyright (C) 2003, 2004, 2007, 2008 - Magnus Henoch - mange@freemail.hu
11 ;; Copyright (C) 2002, 2003, 2004 - Tom Berger - object@intelectronica.net
12
13 ;; SSL - Support, mostly inspired by Gnus
14 ;; Copyright (C) 2005 - Georg Lehner - jorge@magma.com.ni
15
16 ;; This program is free software; you can redistribute it and/or modify
17 ;; it under the terms of the GNU General Public License as published by
18 ;; the Free Software Foundation; either version 2 of the License, or
19 ;; (at your option) any later version.
20
21 ;; This program is distributed in the hope that it will be useful,
22 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;; GNU General Public License for more details.
25
26 ;; You should have received a copy of the GNU General Public License
27 ;; along with this program; if not, write to the Free Software
28 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
30 ;;; Commentary:
31 ;; jabber.el is an XMPP client for Emacs. XMPP (also known as
32 ;; 'Jabber') is the IETF-standard federated instant messaging protocol
33 ;; - see http://xmpp.org for more information.
34
35 ;;; History:
36 ;;
37
38 ;;; Code:
39
40 (require 'cl-lib)
41 (require 'goto-addr)
42
43 ;; These are variables shared with more than one section. For
44 ;; instance, `jabber-process-buffer' is used in jabber-core.el but also in
45 ;; jabber-conn.el.
46
47 ;; Placing these variable definitions before using them avoid
48 ;; byte-compile warnings. Moreover, it is common practice to define
49 ;; variables before its usage.
50
51 (defvar jabber-enable-legacy-features-p nil)
52
53 ;; This was originally defined in jabber-core.el
54 (defvar jabber-process-buffer " *-jabber-process-*"
55 "The name of the process buffer.")
56
57 (defcustom jabber-debug-keep-process-buffers nil
58 "If nil, kill process buffers when the process dies.
59 Contents of process buffers might be useful for debugging."
60 :type 'boolean
61 :group 'jabber-debug)
62
63 (defcustom jabber-silent-mode nil
64 "If non-nil, do not ask for confirmation for some operations. DANGEROUS!"
65 :type 'boolean
66 :group 'jabber)
67
68 ;;; these customize fields should come first
69 (defgroup jabber nil "Jabber instant messaging"
70 :group 'applications)
71
72 ;;;###autoload
73 (defcustom jabber-account-list nil
74 "List of Jabber accounts.
75 Each element of the list is a cons cell describing a Jabber account,
76 where the car is a JID and the CDR is an alist.
77
78 JID is a full Jabber ID string (e.g. foo@bar.tld). You can also
79 specify the resource (e.g. foo@bar.tld/emacs).
80 The following keys can be present in the alist:
81
82 :password is a string to authenticate ourself against the server.
83 It can be empty. If you don't want to store your password in your
84 Emacs configuration, try auth-source (info node `(auth)Top').
85
86 :network-server is a string identifying the address to connect to,
87 if it's different from the server part of the JID.
88
89 :port is the port to use (default depends on connection type).
90
91 :connection-type is a symbol. Valid symbols are `starttls',
92 `network' and `ssl'.
93
94 Only JID is mandatory. The rest can be guessed at run-time.
95
96 Examples:
97
98 Two accounts without any special configuration:
99 \((\"foo@example.com\") (\"bar@example.net\"))
100
101 One disabled account with a non-standard port:
102 \((\"romeo@montague.net\" (:port . 5242) (:disabled . t)))
103
104 If you don't have SRV and STARTTLS capabilities in your Emacs,
105 configure a Google Talk account like this:
106 \((\"username@gmail.com\"
107 (:network-server . \"talk.google.com\")
108 (:connection-type . ssl)))"
109 :type '(repeat
110 (cons :tag "Account information"
111 (string :tag "JID")
112 (set :format "%v"
113 (cons :format "%v"
114 (const :format "" :disabled)
115 (const :tag "Disabled" t))
116 (cons :format "%v"
117 (const :format "" :password)
118 (string :tag "Password"))
119 (cons :format "%v"
120 (const :format "" :network-server)
121 (string :tag "Network server"))
122 (cons :format "%v"
123 (const :format "" :port)
124 (integer :tag "Port" 5222))
125 (cons :format "%v"
126 (const :format "" :connection-type)
127 (choice :tag "Connection type"
128 ;; XXX: detect whether we have STARTTLS? option
129 ;; for enforcing encryption?
130 (const :tag "STARTTLS" starttls)
131 (const :tag "Unencrypted" network)
132 (const :tag "Legacy SSL/TLS" ssl))))))
133 :group 'jabber)
134
135 (defcustom jabber-default-show ""
136 "Default show state."
137 :type '(choice (const :tag "Online" "")
138 (const :tag "Chatty" "chat")
139 (const :tag "Away" "away")
140 (const :tag "Extended away" "xa")
141 (const :tag "Do not disturb" "dnd"))
142 :group 'jabber)
143
144 (defcustom jabber-default-status ""
145 "Default status string."
146 :type 'string
147 :group 'jabber)
148
149 (defcustom jabber-default-priority 10
150 "Default priority."
151 :type 'integer
152 :group 'jabber)
153
154 ;;; guess internal dependencies!
155 (require 'jabber-util)
156 (require 'jabber-menu)
157 (require 'jabber-xml)
158 (require 'jabber-conn)
159 (require 'jabber-core)
160 (require 'jabber-logon)
161 (require 'jabber-roster)
162 (require 'jabber-presence)
163 (require 'jabber-alert)
164 (require 'jabber-chat)
165 (require 'jabber-disco)
166 (require 'jabber-iq)
167 (require 'jabber-widget)
168 (require 'jabber-register)
169 (require 'jabber-search)
170 (require 'jabber-browse)
171 (require 'jabber-muc)
172 (require 'jabber-muc-nick-completion)
173 (require 'jabber-version)
174 (require 'jabber-ahc-presence)
175 (require 'jabber-modeline)
176 (require 'jabber-watch)
177 (require 'jabber-activity)
178 (require 'jabber-vcard)
179 (require 'jabber-events)
180 (require 'jabber-chatstates)
181 (require 'jabber-vcard-avatars)
182 (require 'jabber-autoaway)
183 (require 'jabber-time)
184 (require 'jabber-truncate)
185
186 ;;;###autoload
187 (defvar *jabber-current-status* nil
188 "The user's current presence status.")
189
190 ;;;###autoload
191 (defvar *jabber-current-show* nil
192 "The user's current presence show.")
193
194 ;;;###autoload
195 (defvar *jabber-current-priority* nil
196 "The user's current priority.")
197
198 (defvar *jabber-status-history* nil
199 "History of status messages.")
200
201 (defgroup jabber-faces nil "Faces for displaying Jabber instant messaging."
202 :group 'jabber)
203
204 (defface jabber-title-small
205 '((t (:weight bold :width semi-expanded :height 1.0 :inherit variable-pitch)))
206 "Face for small titles."
207 :group 'jabber-faces)
208
209 (defface jabber-title-medium
210 '((t (:weight bold :width expanded :height 2.0 :inherit variable-pitch)))
211 "Face for medium titles."
212 :group 'jabber-faces)
213
214 (defface jabber-title-large
215 '((t (:weight bold :width ultra-expanded :height 3.0 :inherit variable-pitch)))
216 "Face for large titles."
217 :group 'jabber-faces)
218
219 (defgroup jabber-debug nil "debugging options"
220 :group 'jabber)
221
222 ;;;###autoload
223 (defconst jabber-presence-faces
224 '(("" . jabber-roster-user-online)
225 ("away" . jabber-roster-user-away)
226 ("xa" . jabber-roster-user-xa)
227 ("dnd" . jabber-roster-user-dnd)
228 ("chat" . jabber-roster-user-chatty)
229 ("error" . jabber-roster-user-error)
230 (nil . jabber-roster-user-offline))
231 "Mapping from presence types to faces.")
232
233 (defconst jabber-presence-strings
234 `(("" . ,(jabber-propertize "Online" 'face 'jabber-roster-user-online))
235 ("away" . ,(jabber-propertize "Away" 'face 'jabber-roster-user-away))
236 ("xa" . ,(jabber-propertize "Extended Away" 'face 'jabber-roster-user-xa))
237 ("dnd" . ,(jabber-propertize "Do not Disturb" 'face 'jabber-roster-user-dnd))
238 ("chat" . ,(jabber-propertize "Chatty" 'face 'jabber-roster-user-chatty))
239 ("error" . ,(jabber-propertize "Error" 'face 'jabber-roster-user-error))
240 (nil . ,(jabber-propertize "Offline" 'face 'jabber-roster-user-offline)))
241 "Mapping from presence types to readable, colorized strings.")
242
243 ;;;###autoload
244 (defun jabber-customize ()
245 "Customize Jabber options."
246 (interactive)
247 (customize-group 'jabber))
248
249 ;;;###autoload
250 (defun jabber-info ()
251 "Open jabber.el manual."
252 (interactive)
253 (info "jabber"))
254
255 (provide 'jabber)
256
257 ;;; arch-tag: 5145153e-4d19-4dc2-800c-b1282feb155d
258 ;;; jabber.el ends here