1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <!-- Created by htmlize-1.34 in css mode. -->
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <title>17-emchat.el</title>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8 <meta name="author" content="Steve Youngs" />
9 <meta name="owner" content="steve@sxemacs.org" />
10 <style type="text/css">
14 background-color: #000000;
17 /* font-lock-comment-face */
21 /* font-lock-reference-face */
25 /* font-lock-warning-face */
32 background-color: inherit;
35 text-decoration: underline;
39 background-color: #FD00FD;
40 text-decoration: underline;
43 background-color: #000000;
44 text-decoration: none;
51 <span class="comment">;; 17-emchat.el --- EMchat Settings
53 <span class="comment">;; Copyright (C) 2007 - 2020 Steve Youngs
55 <span class="comment">;; Author: Steve Youngs <<a href="mailto:steve@sxemacs.org">steve@sxemacs.org</a>>
56 ;; Maintainer: Steve Youngs <<a href="mailto:steve@sxemacs.org">steve@sxemacs.org</a>>
57 ;; Created: <2007-12-02>
58 ;; Time-stamp: <Thursday Apr 9, 2020 19:14:30 steve>
59 ;; Download: <<a href="https://downloads.sxemacs.org/SYinits">https://downloads.sxemacs.org/SYinits</a>>
60 ;; HTMLised: <<a href="https://www.sxemacs.org/SYinits/17-emchat.html">https://www.sxemacs.org/SYinits/17-emchat.html</a>>
61 ;; Git Repo: git clone https://git.sxemacs.org/syinit
62 ;; Keywords: init, compile
64 <span class="comment">;; This file is part of SYinit
66 <span class="comment">;; Redistribution and use in source and binary forms, with or without
67 ;; modification, are permitted provided that the following conditions
70 ;; 1. Redistributions of source code must retain the above copyright
71 ;; notice, this list of conditions and the following disclaimer.
73 ;; 2. Redistributions in binary form must reproduce the above copyright
74 ;; notice, this list of conditions and the following disclaimer in the
75 ;; documentation and/or other materials provided with the distribution.
77 ;; 3. Neither the name of the author nor the names of any contributors
78 ;; may be used to endorse or promote products derived from this
79 ;; software without specific prior written permission.
81 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
82 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
83 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
84 ;; DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
85 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
86 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
87 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
88 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
89 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
90 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
91 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
93 <span class="comment">;;; Commentary:
95 ;; My EMchat settings.
97 ;; [2020-02-12] Sadly, everything here is deprecated and non-working. A
98 ;; while back the ICQ people stopped using the OSCAR protocol and disallow
99 ;; ALL 3rd-party clients. On top of that, ICQ is 100% owned and operated
100 ;; by the Russian govt. You probably shouldn't even use the official
101 ;; client as they routinely hand over your chat logs and details to
102 ;; their Russian minders. I wish I was joking. </span><span class="comment"><span class="warning">--SY.</span></span><span class="comment">
104 <span class="comment">;;; Credits:
106 ;; The HTML version of this file was created with Hrvoje Niksic's
107 ;; htmlize.el which is part of the XEmacs "text-modes" package.
110 <span class="comment">;;; Todo:
114 <span class="comment">;;; Code: Entire file commented, see above
115 ;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
116 ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> emchat settings
117 ;; (setq emchat-directory
118 ;; (file-name-as-directory
119 ;; (expand-file-name "emchat" user-init-directory)))
122 <span class="comment">;; ;;; Experimental stuff
123 ;; ;; EMchat works great in a tty, but some settings I use are best
124 ;; ;; suited for X, so this just turns them off.
125 ;; (defun tty-im-setup ()
126 ;; "Set some things so I can use EMchat/Riece in tty."
128 ;; (setq emchat-status-use-gutter nil
129 ;; emchat-start-in-new-frame nil
130 ;; emchat-wharf-frame-use-p nil))
133 <span class="comment">;; (when (device-on-window-system-p)
134 ;; (setq emchat-status-use-gutter t
135 ;; emchat-start-in-new-frame t))
137 <span class="comment">;; (setq
138 ;; emchat-doctor-enabled-flag t
139 ;; emchat-emphasis-enabled-flag t
140 ;; emchat-history-enabled-flag t
141 ;; emchat-log-fill-column 72
143 ;; emchat-server "login.icq.com"
145 ;; emchat-track-enable t
146 ;; emchat-track-indicator-type 'char
147 ;; emchat-user-alias "JackaLX"
148 ;; emchat-user-password (getenv "ICQPASSWD")
149 ;; emchat-user-meta-nickname "JackaLX"
150 ;; emchat-user-meta-firstname "Steve"
151 ;; emchat-user-meta-lastname "Youngs"
152 ;; emchat-user-meta-primary-email "steve@sxemacs.org"
153 ;; emchat-user-meta-secondary-email "steve@steveyoungs.com"
154 ;; emchat-user-meta-city "Brisbane"
155 ;; emchat-user-meta-state "DOA"
156 ;; emchat-user-meta-hide-ip t
157 ;; emchat-user-meta-authorization t
158 ;; emchat-user-meta-about
159 ;; "EMchat Maintainer.\n
160 ;; If you'd like to help out with the EMchat project,
161 ;; please send me a message. Or go to:
162 ;; <<a href="http://www.emchat.org/">http://www.emchat.org/</a>>\n
163 ;; SXEmacs - It's not just an editor.
164 ;; It's a way of life!
165 ;; <<a href="http://www.sxemacs.org/">http://www.sxemacs.org/</a>>"
166 ;; emchat-user-meta-homepage "http://www.sxemacs.org/"
167 ;; emchat-user-meta-sex 'male
168 ;; emchat-user-meta-language-1 12
169 ;; emchat-user-meta-language-2 12
170 ;; emchat-user-meta-language-3 12
171 ;; emchat-user-meta-web-aware t
172 ;; emchat-user-initial-status "online"
173 ;; emchat-user-meta-age 38
174 ;; emchat-user-meta-birth-day 19
175 ;; emchat-user-meta-birth-month 6
176 ;; emchat-user-meta-birth-year 66
177 ;; emchat-user-meta-cell-phone "6666 6666"
178 ;; emchat-user-meta-country 61
179 ;; emchat-user-meta-fax "7777 7777"
180 ;; emchat-user-meta-phone "8888 8888"
181 ;; emchat-user-meta-street "1 Linux Lane"
182 ;; emchat-user-meta-work-homepage "http://www.sxemacs.org/"
183 ;; emchat-user-meta-work-address "What me, work?"
184 ;; emchat-user-meta-work-city "Penguinville"
185 ;; emchat-user-meta-work-company "SlackBiz"
186 ;; emchat-user-meta-work-department "Slackers"
187 ;; emchat-user-meta-work-fax "9999 9999"
188 ;; emchat-user-meta-work-phone "5555 5555"
189 ;; emchat-user-meta-work-position "Seated"
190 ;; emchat-user-meta-work-state "DOA"
191 ;; emchat-user-meta-zipcode "9999"
192 ;; emchat-buddy-view 'emchat-all-aliases
193 ;; emchat-use-sound-flag nil
194 ;; emchat-save-log-on-exit-p nil
195 ;; emchat-log-debug-flag t
196 ;; emchat-user-meta-invisible nil
197 ;; emchat-buddy-show-avatar t
198 ;; emchat-buddy-xface-foreground "black"
199 ;; emchat-buddy-xface-background "red")
201 <span class="comment">;; ;; PulseAudio only seems to work if X is running
202 ;; (when (getenv "DISPLAY")
203 ;; (setq emchat-use-sound-flag t))
205 <span class="comment">;; ;; Lets not auto-away.
206 ;; (customize-set-variable 'emchat-auto-away-timeout 0)
208 <span class="comment">;; (emchat-world-update)
210 <span class="comment">;; (when emchat-use-sound-flag
211 ;; (setq emchat-audio-device
212 ;; ;(make-audio-device 'alsa))
213 ;; (make-audio-device 'pulse
214 ;; </span><span class="comment"><span class="reference">:client</span></span><span class="comment"> "SXEmacs::EMchat"
215 ;; </span><span class="comment"><span class="reference">:stream</span></span><span class="comment"> "EMchat::Stream"
216 ;; </span><span class="comment"><span class="reference">:role</span></span><span class="comment"> "phone"))
217 ;; ;; SXEmacs doesn't like current ffmpeg, and SoX is dodgy ATM too
218 ;; (setq emchat-media-driver 'sndfile)
219 ;; (setq default-media-stream-volume 50)
220 ;; (setq emchat-sound-alist
221 ;; '((auth-sound . "Auth.wav")
222 ;; (buddy-sound . "Online.wav")
223 ;; (chat-sound . "Chat.wav")
224 ;; (emailx-sound . "System.wav")
225 ;; (message-sound . "Message.wav")
226 ;; (pager-sound . "System.wav")
227 ;; (system-sound . "System.wav")
228 ;; (url-sound . "URL.wav"))))
231 <span class="comment">;; ;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
232 ;; ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Addons/extensions
234 <span class="comment">;; (defun sy-emchat-now-playing ()
235 ;; "Return title/artist of current song."
237 ;; (format "NP: %s" (mpd-now-playing)))
239 <span class="comment">;; (defun sy-emchat-send-now-playing ()
240 ;; "Send title/artist of current song."
242 ;; (let ((song (sy-emchat-now-playing))
243 ;; (alias (emchat-alias-around)))
244 ;; (emchat-send-message song alias)))
246 <span class="comment">;; (defun sy-emchat-yow ()
247 ;; "When you can't think of what to say..."
249 ;; (let ((message (yow))
250 ;; (alias (emchat-alias-around)))
251 ;; (emchat-send-message message alias)))
254 <span class="comment">;; (require 'emchat-menu)
255 ;; (define-key emchat-log-mode-map (kbd "C-c p") #'sy-emchat-send-now-playing)
256 ;; (define-key emchat-log-mode-map (kbd "C-c y") #'sy-emchat-yow)
258 <span class="comment">;; ;</span><span class="comment"><span class="reference">:*=======================</span></span><span class="comment">
259 ;; ;</span><span class="comment"><span class="reference">:*</span></span><span class="comment"> Hooks
260 ;; (eval-when-compile
264 <span class="comment">;; ;;(defun sy-emchat-temp (&optional fahrenheit)
265 ;; ;; "Returns a string to send to a ICQ user saying the current temp.
267 <span class="comment">;; ;;With optional arg, FAHRENHEIT, don't send the temp in celsius."
269 ;; ;; (let ((xwem-weather-temperature-format 'fahrenheit))
270 ;; ;; (format "The current temperature here is: %s°F"
271 ;; ;; (substring (xwem-weather-get-temp) 0 -2)))
272 ;; ;; (let ((xwem-weather-temperature-format 'celsius))
273 ;; ;; (format "The current temperature here is: %s°C"
274 ;; ;; (substring (xwem-weather-get-temp) 0 -2)))))
276 <span class="comment">;; (defconst sy-beer-love
277 ;; ["when you realise, 24 beers in a case, 24 hours in a day. Coincidence?"
278 ;; "when you wake up with `</span><span class="comment"><span class="reference">CRS</span></span><span class="comment">'... Can't Remember Shit."
279 ;; "when, to you, it's not a six-pack, it's a support group."
280 ;; "when it is the reason you get up every afternoon."
281 ;; "when you favour the 2 party system... party on Friday, party on Saturday."
282 ;; "when getting f#@ked up is your hobby."]
283 ;; "Proof you love beer.")
285 <span class="comment">;; (defun sy-emchat-beer-love ()
286 ;; (let ((prefix "You know you love beer... ")
287 ;; (love (aref sy-beer-love
288 ;; (% (+ (% (random t) 1000) 1000)
289 ;; (length sy-beer-love)))))
290 ;; (concat prefix love)))
292 <span class="comment">;; (defun sy-emchat-incoming-msg-hook ()
293 ;; (when (or (member alias emchat-visible-contacts)
294 ;; (not (member alias emchat-invisible-contacts)))
295 ;; (let ((repo "The main EMchat git repo is:
296 ;; git clone https://git.emchat.org/emchat")
297 ;; (download "EMchat source tarballs and (S)XEmacs pkg tarballs
298 ;; can be downloaded from: Offline ATM, sorry")
299 ;; (latest (shell-command-to-string
300 ;; "cd ~/programming/EMchat/emchat && git describe"))
301 ;; (lastlog (shell-command-to-string
302 ;; "cd ~/programming/EMchat/emchat && git log -1"))
303 ;; (time (format-time-string "The local time here is: %c"))
304 ;; (beer (sy-emchat-beer-love))
305 ;; (song (sy-emchat-now-playing))
306 ;; (help "Cmds are prefixed with `,,' (ie, ,,cmd). Only the first
307 ;; valid cmd in a msg is accepted. The cmd can appear anywhere in
310 <span class="comment">;; Accepted cmds: version, latest, lastlog, emchat-repo, download, yow,
311 ;; time, beer, song, help."))
312 ;; (cond ((string-match ",,version" message)
313 ;; (emchat-send-message-helper
314 ;; (format "I am using %s" (emchat-version)) (list alias)
315 ;; 'automatic "Version sent"))
316 ;; ((string-match ",,latest" message)
317 ;; (emchat-send-message-helper latest (list alias) 'automatic "Latest sent"))
318 ;; ((string-match ",,lastlog" message)
319 ;; (emchat-send-message-helper lastlog (list alias) 'automatic "Lastlog sent"))
320 ;; ((string-match ",,emchat-repo" message)
321 ;; (emchat-send-message-helper repo (list alias) 'automatic "Repo sent"))
322 ;; ((string-match ",,download" message)
323 ;; (emchat-send-message-helper download (list alias) 'automatic "Download sent"))
324 ;; ((string-match ",,yow" message)
325 ;; (emchat-send-message-helper (format "%s" (yow)) (list alias)
326 ;; 'automatic "Yow sent"))
327 ;; ((string-match ",,time" message)
328 ;; (emchat-send-message-helper time (list alias) 'automatic "Time sent"))
329 ;; ;((string-match ",,temp-f" message)
330 ;; ; (emchat-send-message (sy-emchat-temp 'fahrenheit) alias))
331 ;; ;((string-match ",,temp" message)
332 ;; ; (emchat-send-message (sy-emchat-temp) alias))
333 ;; ((string-match ",,beer" message)
334 ;; (emchat-send-message-helper beer (list alias) 'automatic "Beer sent"))
335 ;; ((string-match ",,song" message)
336 ;; (emchat-send-message-helper song (list alias) 'automatic "Song sent"))
337 ;; ((string-match ",,help" message)
338 ;; (emchat-send-message-helper help (list alias) 'automatic "Help sent"))))))
340 <span class="comment">;; (add-hook 'emchat-new-message-hook #'sy-emchat-incoming-msg-hook)
342 <span class="comment">;; (defun sy-emchat-zero-wharf ()
343 ;; "Helper func to zero wharf counters."
345 ;; (emchat-wharf-change-messages "New" -9999)
346 ;; (emchat-wharf-change-messages "Sys" -9999))
348 <span class="comment">;; ;; Use the Wharf if not using XWEM
349 ;; (unless (or (string= "notyet" (getenv "XWEM_RUNNING"))
350 ;; (string= "yes" (getenv "XWEM_RUNNING"))
351 ;; (not (device-on-window-system-p)))
352 ;; (require 'emchat-wharf)
353 ;; (setq emchat-wharf-frame-use-p t)
354 ;; (setq emchat-wharf-notice-riece-flag t)
355 ;; (push (cons 'left 1690) emchat-wharf-frame-props)
356 ;; (push (cons 'top 5) emchat-wharf-frame-props)
357 ;; (push (cons 'internal-border-width 4) emchat-wharf-frame-props)
358 ;; ;; `</span><span class="comment"><span class="reference">override-redirect</span></span><span class="comment">' means no WM decorations, and you also get
359 ;; ;; sticky and always on top and skip pagers and task lists etc.
360 ;; ;; The downside is that often new windows will appear underneath
361 ;; ;; because the WM/DE has no knowledge of its existence. I don't
362 ;; ;; use this in KDE because you can easily get the same effect
363 ;; ;; without the downside with KDE's "Window Rules". I also don't
364 ;; ;; use this in Sawfish for similar reasons.
365 ;; (unless (or (string= (getenv "KDE_FULL_SESSION") "true")
366 ;; (string= (getenv "SAWFISH_IS_RUNNING") "true"))
367 ;; (push (cons 'override-redirect t) emchat-wharf-frame-props))
368 ;; (push (cons 'border-width 1) emchat-wharf-frame-props)
369 ;; (push (cons 'border-color "red") emchat-wharf-frame-props)
370 ;; (add-hook 'emchat-new-message-hook #'emchat-wharf-inc-messages)
371 ;; (add-hook 'emchat-system-message-hook #'emchat-wharf-inc-system)
372 ;; (add-hook 'emchat-read-message-hook #'emchat-wharf-dec-messages)
373 ;; (add-hook 'riece-biff-activity-hook #'emchat-wharf-riece-active)
374 ;; (add-hook 'riece-biff-clear-hook #'emchat-wharf-riece-inactive)
375 ;; (add-hook 'emchat-track-clear-hook #'sy-emchat-zero-wharf)
376 ;; (define-key emchat-log-mode-map [?C] #'sy-emchat-zero-wharf))
378 <span class="comment">;; ;</span><span class="comment"><span class="reference">:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*</span></span><span class="comment">
379 ;; (message "EMchat settings loaded")
381 <!-- SXEmacs Logo -->
383 <a href="https://www.sxemacs.org/" target="_parent">
384 <img style="padding:0px 5px 0px 0px;border:0;width:88px;height:31px"
385 src="/Images/cbsx.png"
386 title="This page was created entirely in SXEmacs"
387 alt="Created with SXEmacs" />
389 <!-- End SXEmacs Logo -->
390 <!-- Valid XHTML 1.0 -->
391 <a href="http://validator.w3.org/check?uri=https%3a%2f%2fwww.sxemacs.org%2fSYinits%2f17-emchat.html" target="_blank">
392 <img style="padding:0px 5px 0px 10px;border:0;width:88px;height:31px"
393 src="/Images/valid-xhtml10.png"
394 title="Valid XHTML 1.0 Transitional!"
395 alt="Valid XHTML 1.0 Transitional!" />
398 <!-- End Valid XHTML 1.0 -->
400 <h6>Copyright © 2020 Steve Youngs<br />
401 Verbatim copying and distribution is permitted in any medium,
402 providing this notice is preserved.<br />
404 Last modified: Wed Apr 15 18:16:13 AEST 2020