Version 0.8.90
[emacs-jabber.git] / jabber.el
blob906136da3107dc4e9015aa74188cc1703c346405
1 ;; jabber.el - a minimal jabber client
3 ;; Copyright (C) 2003, 2004, 2007, 2008 - Magnus Henoch - mange@freemail.hu
4 ;; Copyright (C) 2002, 2003, 2004 - tom berger - object@intelectronica.net
6 ;; SSL - Support, mostly inspired by Gnus
7 ;; Copyright (C) 2005 - Georg Lehner - jorge@magma.com.ni
9 ;; This file is a part of jabber.el.
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2 of the License, or
14 ;; (at your option) any later version.
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program; if not, write to the Free Software
23 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 ;;; load Unicode tables if this needed
26 (when (and (featurep 'xemacs) (not (emacs-version>= 21 5 5)))
27 (require 'un-define))
29 ;;; these customize fields should come first
30 (defgroup jabber nil "Jabber instant messaging"
31 :group 'applications)
33 ;;;###autoload
34 (defcustom jabber-account-list nil
35 "List of Jabber accounts.
36 Each element of the list is a cons cell describing a Jabber account,
37 where the car is a JID and the CDR is an alist.
39 JID is a full Jabber ID string (e.g. foo@bar.tld). You can also
40 specify the resource (e.g. foo@bar.tld/emacs).
41 The following keys can be present in the alist:
42 :password is a string to authenticate ourself against the server.
43 It can be empty.
44 :network-server is a string identifying the address to connect to,
45 if it's different from the server part of the JID.
46 :port is the port to use (default depends on connection type).
47 :connection-type is a symbol. Valid symbols are `starttls',
48 `network' and `ssl'.
50 Only JID is mandatory. The rest can be guessed at run-time.
52 Examples:
54 Two accounts without any special configuration:
55 \((\"foo@example.com\") (\"bar@example.net\"))
57 One disabled account with a non-standard port:
58 \((\"romeo@montague.net\" (:port . 5242) (:disabled . t)))
60 If you don't have SRV and STARTTLS capabilities in your Emacs,
61 configure a Google Talk account like this:
62 \((\"username@gmail.com\"
63 (:network-server . \"talk.google.com\")
64 (:connection-type . ssl)))"
65 :type '(repeat
66 (cons :tag "Account information"
67 (string :tag "JID")
68 (set :format "%v"
69 (cons :format "%v"
70 (const :format "" :disabled)
71 (const :tag "Disabled" t))
72 (cons :format "%v"
73 (const :format "" :password)
74 (string :tag "Password"))
75 (cons :format "%v"
76 (const :format "" :network-server)
77 (string :tag "Network server"))
78 (cons :format "%v"
79 (const :format "" :port)
80 (integer :tag "Port" 5222))
81 (cons :format "%v"
82 (const :format "" :connection-type)
83 (choice :tag "Connection type"
84 ;; XXX: detect whether we have STARTTLS? option
85 ;; for enforcing encryption?
86 (const :tag "STARTTLS" starttls)
87 (const :tag "Unencrypted" network)
88 (const :tag "Legacy SSL/TLS" ssl))))))
89 :group 'jabber)
91 ;;;###autoload
92 (defcustom jabber-default-show ""
93 "default show state"
94 :type '(choice (const :tag "Online" "")
95 (const :tag "Chatty" "chat")
96 (const :tag "Away" "away")
97 (const :tag "Extended away" "xa")
98 (const :tag "Do not disturb" "dnd"))
99 :group 'jabber)
101 ;;;###autoload
102 (defcustom jabber-default-status ""
103 "default status string"
104 :type 'string
105 :group 'jabber)
107 ;;;###autoload
108 (defcustom jabber-default-priority 10
109 "default priority"
110 :type 'integer
111 :group 'jabber)
113 ;;; guess internal dependencies!
114 (require 'jabber-util)
115 (require 'jabber-menu)
116 (require 'jabber-xml)
117 (require 'jabber-conn)
118 (require 'jabber-core)
119 (require 'jabber-logon)
120 (require 'jabber-roster)
121 (require 'jabber-presence)
122 (require 'jabber-alert)
123 (require 'jabber-chat)
124 (require 'jabber-disco)
125 (require 'jabber-iq)
126 (require 'jabber-widget)
127 (require 'jabber-register)
128 (require 'jabber-search)
129 (require 'jabber-browse)
130 (require 'jabber-muc)
131 (require 'jabber-muc-nick-completion)
132 (require 'jabber-version)
133 (require 'jabber-ahc-presence)
134 (require 'jabber-modeline)
135 (require 'jabber-watch)
136 (require 'jabber-activity)
137 (require 'jabber-vcard)
138 (require 'jabber-events)
139 (require 'jabber-chatstates)
140 (require 'jabber-vcard-avatars)
141 (require 'jabber-autoaway)
142 (require 'jabber-time)
143 (require 'jabber-truncate)
145 (require 'jabber-ft-client)
146 (require 'jabber-ft-server)
147 (require 'jabber-socks5)
149 ;; External notifiers
150 (require 'jabber-screen)
151 (require 'jabber-ratpoison)
152 (require 'jabber-sawfish)
153 (require 'jabber-festival)
154 (require 'jabber-xmessage)
155 (require 'jabber-wmii)
156 (require 'jabber-osd)
157 (require 'jabber-awesome)
158 (require 'jabber-libnotify)
160 (require 'jabber-autoloads)
162 ;;;###autoload
163 (defvar *jabber-current-status* nil
164 "the users current presence status")
166 ;;;###autoload
167 (defvar *jabber-current-show* nil
168 "the users current presence show")
170 ;;;###autoload
171 (defvar *jabber-current-priority* nil
172 "the user's current priority")
174 (defvar *jabber-status-history* nil
175 "history of status messages")
177 (defgroup jabber-faces nil "faces for displaying jabber instant messaging"
178 :group 'jabber)
180 (defface jabber-title-small
181 '((t (:weight bold :width semi-expanded :height 1.0 :inherit variable-pitch)))
182 "face for small titles"
183 :group 'jabber-faces)
185 (defface jabber-title-medium
186 '((t (:weight bold :width expanded :height 2.0 :inherit variable-pitch)))
187 "face for medium titles"
188 :group 'jabber-faces)
190 (defface jabber-title-large
191 '((t (:weight bold :width ultra-expanded :height 3.0 :inherit variable-pitch)))
192 "face for large titles"
193 :group 'jabber-faces)
195 (defgroup jabber-debug nil "debugging options"
196 :group 'jabber)
198 ;;;###autoload
199 (defcustom jabber-debug-log-xml nil
200 "Set to non-nil to log all XML i/o in *-jabber-console-JID-* buffer. Set to string to also dump XML i/o in specified file."
201 :type '(choice (const :tag "Do not dump XML i/o" nil)
202 (const :tag "Dump XML i/o in console" t)
203 (string :tag "Dump XML i/o in console and this file"))
204 :group 'jabber-debug
205 :require 'jabber-console)
207 ;;;###autoload
208 (defcustom jabber-debug-keep-process-buffers nil
209 "If nil, kill process buffers when the process dies.
210 Contents of process buffers might be useful for debugging."
211 :type 'boolean
212 :group 'jabber-debug)
214 (defcustom jabber-silent-mode nil
215 "Silent mode switch. Not ask confirmanions for some operations. DANGEROUS!"
216 :type 'boolean
217 :group 'jabber)
219 ;;;###autoload
220 (defconst jabber-presence-faces
221 '(("" . jabber-roster-user-online)
222 ("away" . jabber-roster-user-away)
223 ("xa" . jabber-roster-user-xa)
224 ("dnd" . jabber-roster-user-dnd)
225 ("chat" . jabber-roster-user-chatty)
226 ("error" . jabber-roster-user-error)
227 (nil . jabber-roster-user-offline))
228 "Mapping from presence types to faces")
230 (defconst jabber-presence-strings
231 `(("" . ,(jabber-propertize "Online" 'face 'jabber-roster-user-online))
232 ("away" . ,(jabber-propertize "Away" 'face 'jabber-roster-user-away))
233 ("xa" . ,(jabber-propertize "Extended Away" 'face 'jabber-roster-user-xa))
234 ("dnd" . ,(jabber-propertize "Do not Disturb" 'face 'jabber-roster-user-dnd))
235 ("chat" . ,(jabber-propertize "Chatty" 'face 'jabber-roster-user-chatty))
236 ("error" . ,(jabber-propertize "Error" 'face 'jabber-roster-user-error))
237 (nil . ,(jabber-propertize "Offline" 'face 'jabber-roster-user-offline)))
238 "Mapping from presence types to readable, colorized strings")
240 ;;;###autoload
241 (defun jabber-customize ()
242 "customize jabber options"
243 (interactive)
244 (customize-group 'jabber))
246 ;;;###autoload
247 (defun jabber-info ()
248 "open jabber.el manual"
249 (interactive)
250 (info "jabber"))
252 (provide 'jabber)
254 ;;; arch-tag: 5145153e-4d19-4dc2-800c-b1282feb155d