1 ;;; jabber.el --- a minimal jabber client -*- lexical-binding: t; -*-
3 ;; Author: Magnus Henoch <mange@freemail.hu>
4 ;; Maintainer: wgreenhouse <wgreenhouse@tilde.club>
6 ;; Homepage: https://codeberg.org/emacs-jabber/emacs-jabber
7 ;; Package-Requires: ((emacs "27.1") (fsm "0.1.0") (srv "0.1.0"))
10 ;; Copyright (C) 2003, 2004, 2007, 2008 - Magnus Henoch - mange@freemail.hu
11 ;; Copyright (C) 2002, 2003, 2004 - Tom Berger - object@intelectronica.net
13 ;; SSL - Support, mostly inspired by Gnus
14 ;; Copyright (C) 2005 - Georg Lehner - jorge@magma.com.ni
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.
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.
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
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.
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
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.
51 (defvar jabber-enable-legacy-features-p nil)
53 ;; This was originally defined in jabber-core.el
54 (defvar jabber-process-buffer " *-jabber-process-*"
55 "The name of the process buffer.")
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."
63 (defcustom jabber-silent-mode nil
64 "If non-nil, do not ask for confirmation for some operations. DANGEROUS!"
68 ;;; these customize fields should come first
69 (defgroup jabber nil "Jabber instant messaging"
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.
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:
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').
86 :network-server is a string identifying the address to connect to,
87 if it's different from the server part of the JID.
89 :port is the port to use (default depends on connection type).
91 :connection-type is a symbol. Valid symbols are `starttls',
94 Only JID is mandatory. The rest can be guessed at run-time.
98 Two accounts without any special configuration:
99 \((\"foo@example.com\") (\"bar@example.net\"))
101 One disabled account with a non-standard port:
102 \((\"romeo@montague.net\" (:port . 5242) (:disabled . t)))
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)))"
110 (cons :tag "Account information"
114 (const :format "" :disabled)
115 (const :tag "Disabled" t))
117 (const :format "" :password)
118 (string :tag "Password"))
120 (const :format "" :network-server)
121 (string :tag "Network server"))
123 (const :format "" :port)
124 (integer :tag "Port" 5222))
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))))))
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"))
144 (defcustom jabber-default-status ""
145 "Default status string."
149 (defcustom jabber-default-priority 10
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)
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)
187 (defvar *jabber-current-status* nil
188 "The user's current presence status.")
191 (defvar *jabber-current-show* nil
192 "The user's current presence show.")
195 (defvar *jabber-current-priority* nil
196 "The user's current priority.")
198 (defvar *jabber-status-history* nil
199 "History of status messages.")
201 (defgroup jabber-faces nil "Faces for displaying Jabber instant messaging."
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)
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)
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)
219 (defgroup jabber-debug nil "debugging options"
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.")
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.")
244 (defun jabber-customize ()
245 "Customize Jabber options."
247 (customize-group 'jabber))
250 (defun jabber-info ()
251 "Open jabber.el manual."
257 ;;; arch-tag: 5145153e-4d19-4dc2-800c-b1282feb155d
258 ;;; jabber.el ends here