You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(24) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(66) |
Feb
(15) |
Mar
(15) |
Apr
(23) |
May
(16) |
Jun
(29) |
Jul
|
Aug
(5) |
Sep
(40) |
Oct
(10) |
Nov
(2) |
Dec
(25) |
2006 |
Jan
(43) |
Feb
(7) |
Mar
(11) |
Apr
(15) |
May
(7) |
Jun
(13) |
Jul
(13) |
Aug
(6) |
Sep
(3) |
Oct
|
Nov
(9) |
Dec
(12) |
2007 |
Jan
(5) |
Feb
(9) |
Mar
(27) |
Apr
(20) |
May
(20) |
Jun
(4) |
Jul
(54) |
Aug
(67) |
Sep
(27) |
Oct
(9) |
Nov
(18) |
Dec
(11) |
2008 |
Jan
(32) |
Feb
(29) |
Mar
(15) |
Apr
(6) |
May
(11) |
Jun
(2) |
Jul
(3) |
Aug
|
Sep
(17) |
Oct
(19) |
Nov
(8) |
Dec
(13) |
2009 |
Jan
(8) |
Feb
(3) |
Mar
(11) |
Apr
(18) |
May
(4) |
Jun
(2) |
Jul
(7) |
Aug
(12) |
Sep
(20) |
Oct
(1) |
Nov
(2) |
Dec
(9) |
2010 |
Jan
(1) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(13) |
Jun
|
Jul
(5) |
Aug
(4) |
Sep
(7) |
Oct
(9) |
Nov
|
Dec
(6) |
2011 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(19) |
Sep
(1) |
Oct
(10) |
Nov
(2) |
Dec
(6) |
2012 |
Jan
(1) |
Feb
(3) |
Mar
(23) |
Apr
(1) |
May
(3) |
Jun
|
Jul
|
Aug
(1) |
Sep
(7) |
Oct
(3) |
Nov
(5) |
Dec
|
2013 |
Jan
(4) |
Feb
(6) |
Mar
(1) |
Apr
(20) |
May
(9) |
Jun
(1) |
Jul
(8) |
Aug
(14) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(1) |
2014 |
Jan
(1) |
Feb
(16) |
Mar
|
Apr
(1) |
May
(3) |
Jun
(11) |
Jul
(7) |
Aug
(13) |
Sep
(4) |
Oct
|
Nov
(2) |
Dec
(2) |
2015 |
Jan
(2) |
Feb
(4) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(1) |
Jul
(9) |
Aug
(2) |
Sep
(2) |
Oct
(1) |
Nov
(5) |
Dec
(1) |
2016 |
Jan
(6) |
Feb
(1) |
Mar
(5) |
Apr
|
May
(7) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(4) |
2017 |
Jan
(5) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
(10) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
From: Adam S. <as...@ko...> - 2024-12-26 14:55:23
|
Adam Sjøgren writes: >> Has anyone taken a stab at implementing support for Last Message >> Correction? > > I have now done an attempt: > > · https://koldfront.dk/git/jabber-last-message-correction/ 4 years later, and I have now fixed it to be able to correct the latest message to any other user, instead of just the latest message sent. Merry christmas! Adam -- "Accept failure gracefully." Adam Sjøgren as...@ko... |
From: Adam S. <as...@ko...> - 2024-12-15 18:49:00
|
Adam Sjøgren writes: > (add-hook 'jabber-alert-presence-hooks (lambda () (force-mode-line-update t)) 100) Nah, it has to take the right number of arguments, so more like: (add-hook 'jabber-alert-presence-hooks (lambda (who old new text alert) (force-mode-line-update t))) D'oh, Adam -- "Money always takes the place of life" Adam Sjøgren as...@ko... |
From: Adam S. <as...@ko...> - 2024-12-14 14:04:44
|
Hi, For some time I have been annoyed by seeing a user status update in a message at the bottom of the Emacs window, but the header line not updating at the same time. This seems to fix it: (add-hook 'jabber-alert-presence-hooks (lambda () (force-mode-line-update t)) 100) even though it might be a bit of a big hammer solution :-) Best regards, Adam -- "Har du computer, som starter op i DOS, så' det: Adam Sjøgren *blah* *blah* Adios amigos!" as...@ko... |
From: Daniel C. <dan...@br...> - 2023-08-20 21:15:24
|
as...@ko... (Adam Sjøgren) writes: > Is anyone working on OMEMO-support for jabber.el? > > I have been using OTR with jabber.el for quite a while, and it works > well, but OMEMO sounds even better: > > »Finally I can send encrypted messages to someone who is currently > offline, uses multiple clients and simultaneously receive a copy of > that message on all of my devices.« ⌘ https://conversations.im/omemo/ I am also looking forward for OMEMO in jabber.el. Because I already use XMPP in my Android, using Conversations, and I want to use XMPP in my GNU Emacs too. I will only use clients that support encryption that Conversations supports (OMEMO or OpenPGP). Without that I won't use such client. That is why I have been using Profanity, on my PC. But XMPP on GNU Emacs would be best, that is why I am looking forward for OMEMO in jabber.el. Any news about OMEMO in jabber.el? |
From: Christian <cnn...@gm...> - 2021-12-24 14:01:56
|
On Fri, 24 Dec 2021 09:13:55 -0300, Adam Sjøgren via Emacs-jabber-general wrote: > > Christian writes: > > > With wgreenhouse and contrapunctus we were working on porting > > jabber.el into lexical binding, fixing the byte-compiling warnings, > > and fixing the checkdoc errors too. Our aim is to make the library > > available for Emacs 28 and to upload it to MELPA. > > Ah, how very cool! Give it a try! And tell us if you find something wrong! > > > The lexical-binding is complete (or I cann't find any problems). Although, the > > byte-compiling warnings and checkdoc errors are still in progress. > > 👍 > > > Maybe, these repos is what you are looking for: > > > > - https://gitlab.com/cnngimenez/emacs-jabber > > - https://tildegit.org/wgreenhouse/emacs-jabber > > Thanks, I hadn't found any of these, sweet! Well, when we're done uploading the package to MELPA, the repositories would be more organized. At that time, we should decide which one would be registered on the MELPA metadata or if we should create one for that purpose. > > I've hacked together some small improvements over the years - it would > be great to converge somewhere - most notable, for me, the ability to > upload or paste, send and show images. I tried to implement the HTTP-Upload at [1] (XEP-0363), the XEP used by Conversations and Gajim by default to send images and audio. Maybe this is what you mean? For some reason I didn't (or I forgot?) to upload the .el file, but just tangle the jabber-httpupload.org and load the library. The org file has explanations about how does the XEP and the library works. The library should work on Emacs 28. I tested it a little using Conversations as the receiver of the images and the suchat.org server. But, jabber-httpupload.el does not show received images, it has functions to send files only. > > > Best regards, > > Adam Cheers! > > -- > "I am still twitching at the idea that you need to Adam Sjøgren > load code into the kernel in order to re-map a as...@ko... > mouse button." > > > > _______________________________________________ > Emacs-jabber-general mailing list > Ema...@li... > https://lists.sourceforge.net/lists/listinfo/emacs-jabber-general [1] https://gitlab.com/cnngimenez/emacs-jabber/-/blob/http-upload/jabber-httpupload.org |
From: Adam S. <as...@ko...> - 2021-12-24 12:14:29
|
Christian writes: > With wgreenhouse and contrapunctus we were working on porting > jabber.el into lexical binding, fixing the byte-compiling warnings, > and fixing the checkdoc errors too. Our aim is to make the library > available for Emacs 28 and to upload it to MELPA. Ah, how very cool! > The lexical-binding is complete (or I cann't find any problems). Although, the > byte-compiling warnings and checkdoc errors are still in progress. 👍 > Maybe, these repos is what you are looking for: > > - https://gitlab.com/cnngimenez/emacs-jabber > - https://tildegit.org/wgreenhouse/emacs-jabber Thanks, I hadn't found any of these, sweet! I've hacked together some small improvements over the years - it would be great to converge somewhere - most notable, for me, the ability to upload or paste, send and show images. Best regards, Adam -- "I am still twitching at the idea that you need to Adam Sjøgren load code into the kernel in order to re-map a as...@ko... mouse button." |
From: Christian <cnn...@gm...> - 2021-12-23 23:01:27
|
Hi! With wgreenhouse and contrapunctus we were working on porting jabber.el into lexical binding, fixing the byte-compiling warnings, and fixing the checkdoc errors too. Our aim is to make the library available for Emacs 28 and to upload it to MELPA. The lexical-binding is complete (or I cann't find any problems). Although, the byte-compiling warnings and checkdoc errors are still in progress. Maybe, these repos is what you are looking for: - https://gitlab.com/cnngimenez/emacs-jabber - https://tildegit.org/wgreenhouse/emacs-jabber You're welcome to join the XMPP MUC em...@sa... [1] to chat with us! Cheers! [1] xmpp:em...@sa...?join https://conversations.im/j/em...@sa... On Wed, 22 Dec 2021 19:06:07 -0300, Adam Sjøgren via Emacs-jabber-general wrote: > > Inspired by a blog post¹ on planet emacslife, I half-tried to > thoughtlessly switch every use of 'cl to 'cl-lib in emacs-jabber, and > then fixing all the complaints the byte-compiler threw at me. > > I got through about half of the files when I got tired, stopped, and > tried using the result - which was not connecting to the server an > showing empty menus. Fail. > > So I changed everything back and gave up for the day. > > Anyone try this with a better result? > > I know I could probably just ignore the "Package cl is deprecated" > messages for another decade or so, but still.. > > > Best regards, > > Adam > > ¹ https://gonsie.com/blorg/cl-deprecated.html (unreadable in my browser, > but the post is still on https://planet.emacslife.com/ ) > > -- > "Just because any random joe can't add code to Adam Sjøgren > without passing it through Mozilla people doesn't as...@ko... > mean it's not free software." > > > > _______________________________________________ > Emacs-jabber-general mailing list > Ema...@li... > https://lists.sourceforge.net/lists/listinfo/emacs-jabber-general |
From: Adam S. <as...@ko...> - 2021-12-22 22:06:45
|
Inspired by a blog post¹ on planet emacslife, I half-tried to thoughtlessly switch every use of 'cl to 'cl-lib in emacs-jabber, and then fixing all the complaints the byte-compiler threw at me. I got through about half of the files when I got tired, stopped, and tried using the result - which was not connecting to the server an showing empty menus. Fail. So I changed everything back and gave up for the day. Anyone try this with a better result? I know I could probably just ignore the "Package cl is deprecated" messages for another decade or so, but still.. Best regards, Adam ¹ https://gonsie.com/blorg/cl-deprecated.html (unreadable in my browser, but the post is still on https://planet.emacslife.com/ ) -- "Just because any random joe can't add code to Adam Sjøgren without passing it through Mozilla people doesn't as...@ko... mean it's not free software." |
From: Adam S. <as...@ko...> - 2021-02-16 17:01:27
|
Mandar writes: > Can I just update via ELPA to get the hottest version? No, jabber-http-file-upload.el is not on ELPA. I found it on Microsoft GitHub¹ and made some attempts at improvements². > BTW, what is C-x C-j C-y a shortcut for? That is they key sequence I have bound the new jabber-http-selection-upload function to, which takes the current image from the clipboard, uploads it via XEP-0363 and sends it. > Recurring question (wishful thinking, more like): I use (and love) > jabber.el for one-to-one Google Chat, but it doesn't work for group > Hangouts. I suppose that has to do with Google's proprietary ****? I don't know, I haven't used Google Chat and I don't know anyone who does. I thought they had stopped federating, but perhaps you can still connect directly? > Thanks for running this show! Whoever that might be, doing that! Best regards, Adam ¹ https://github.com/yuchangyuan/jabber-http-file-upload ² https://koldfront.dk/git/jabber-http-file-upload/ -- "So I was off a little bit, sue me." Adam Sjøgren as...@ko... |
From: Mandar M. <man...@gm...> - 2021-02-16 06:48:39
|
Adam Sjøgren via Emacs-jabber-general wrote (Mon, Feb 15, 2021 at 10:52:56PM +0100): > Adam Sjøgren writes: > > > I have now reached "inline images in jabber.el"-nirvana. Easter > > vacation joy! > > One thing was missing: being able to paste an image directly into > jabber.el, not having to save it as a file first. > > I have now implemented just that missing functionality: > > · https://koldfront.dk/git/jabber-http-file-upload/commit/?id=f22d0c3bc9684842631c87d3b9e1453a8ec87289 > > I gotta say, I'm pretty chuffed about it - copy an image from somewhere, > anywhere (a browser, Gimp, flameshot) and simply C-x C-j C-y and the > image is uploaded and sent. Whee! Amazing! Wheee! from me too!! :-) Can I just update via ELPA to get the hottest version? BTW, what is C-x C-j C-y a shortcut for? Recurring question (wishful thinking, more like): I use (and love) jabber.el for one-to-one Google Chat, but it doesn't work for group Hangouts. I suppose that has to do with Google's proprietary ****? Thanks for running this show! -mandar |
From: Adam S. <as...@ko...> - 2021-02-15 22:08:47
|
Adam Sjøgren writes: > I have now reached "inline images in jabber.el"-nirvana. Easter > vacation joy! One thing was missing: being able to paste an image directly into jabber.el, not having to save it as a file first. I have now implemented just that missing functionality: · https://koldfront.dk/git/jabber-http-file-upload/commit/?id=f22d0c3bc9684842631c87d3b9e1453a8ec87289 I gotta say, I'm pretty chuffed about it - copy an image from somewhere, anywhere (a browser, Gimp, flameshot) and simply C-x C-j C-y and the image is uploaded and sent. Whee! Best regards, Adam -- "You shouldn't let poets lie to you." Adam Sjøgren as...@ko... |
From: Joshua B. <jb...@di...> - 2020-10-29 18:15:28
|
I also use Jabber for jmp.chat, which is awesome! -- Joshua Branson Sent from Emacs and Gnus https://gnucode.me https://video.hardlimit.com/accounts/joshua_branson/video-channels "You can have whatever you want, as long as you help enough other people get what they want." - Zig Ziglar |
From: Mandar M. <man...@gm...> - 2020-09-10 15:47:08
|
Hello, I thought emacs was being a little sluggish, and that it was consuming a fair amount of memory, so I ran the CPU and Memory profilers. Here's part of the output from the memory profiler. - timer-event-handler 26,071,671 53% - apply 26,026,815 53% - fsm-send-sync 17,011,566 35% - #<compiled 0x15640aa8ddf9> 16,941,102 34% - jabber-roster-update 16,909,926 34% - jabber-display-roster 16,813,054 34% + ewoc-enter-after 14,806,110 30% Is there anything I can do to fix this? E.g., increase the interval between roster updates? Thanks very much! -mandar |
From: Adam S. <as...@ko...> - 2020-07-23 16:11:38
|
Mandar writes: > Are you the writer of / maintainer for jabber.el? If so, many thanks! Nope, I'm just a happy user, and occasional tinkerer. Best regards, Adam -- "I would therefore like to posit that computing's Adam Sjøgren central challenge 'How not to make a mess of it,' as...@ko... has *not* been met." |
From: Mandar M. <man...@gm...> - 2020-07-23 15:51:58
|
Adam Sjøgren via Emacs-jabber-general wrote (Thu, Jul 23, 2020 at 05:43:25PM +0200): > Mandar writes: > > >> Is anybody else still using jabber.el? > > > Meaning, in general? I do, as an interface to Google Talk / Chat / > > Hangouts or whatever it's called. Love it! > > Yes, I meant in general - I kind of felt like I was having a lonely, > slow moving monologue on this mailing list :-) > > Great to hear that it is also useful to you! Are you the writer of / maintainer for jabber.el? If so, many thanks! Starting a different thread unrelated to Last Message Correction. -mandar |
From: Adam S. <as...@ko...> - 2020-07-23 15:43:49
|
Mandar writes: >> Is anybody else still using jabber.el? > Meaning, in general? I do, as an interface to Google Talk / Chat / > Hangouts or whatever it's called. Love it! Yes, I meant in general - I kind of felt like I was having a lonely, slow moving monologue on this mailing list :-) Great to hear that it is also useful to you! Best regards, Adam -- "He who writes the code chooses the Adam Sjøgren license, and anyone else is a whiner." as...@ko... |
From: Mandar M. <man...@gm...> - 2020-07-23 15:38:44
|
Adam Sjøgren via Emacs-jabber-general wrote (Thu, Jul 23, 2020 at 05:24:13PM +0200): > Adam Sjøgren writes: > > > Has anyone taken a stab at implementing support for Last Message > > Correction? > > I have now done an attempt: > > · https://koldfront.dk/git/jabber-last-message-correction/ > > It doesn't update the old message, it just adds a new one, and it only > allows you to edit the last message you have sent, regardless of > recipient. > > So it's not complete, but it does some of the job. > > Is anybody else still using jabber.el? Meaning, in general? I do, as an interface to Google Talk / Chat / Hangouts or whatever it's called. Love it! -mandar |
From: Adam S. <as...@ko...> - 2020-07-23 15:24:26
|
Adam Sjøgren writes: > Has anyone taken a stab at implementing support for Last Message > Correction? I have now done an attempt: · https://koldfront.dk/git/jabber-last-message-correction/ It doesn't update the old message, it just adds a new one, and it only allows you to edit the last message you have sent, regardless of recipient. So it's not complete, but it does some of the job. Is anybody else still using jabber.el? Best regards, Adam -- "Examination and mastering of a new highly Adam Sjøgren intellectual equipment was a hard labour." as...@ko... |
From: Adam S. <as...@ko...> - 2020-07-23 12:28:32
|
Hi, Has anyone taken a stab at implementing support for Last Message Correction? · https://xmpp.org/extensions/xep-0308.html I'm a lazy typist and regularly want to fix an embarrasing mistake in a message I've just sent... Best regards, Adam -- "Écoutez la colere du peuple" Adam Sjøgren as...@ko... |
From: Adam S. <as...@ko...> - 2019-07-29 14:48:35
|
This because at least ejabberd 18.12.1 (as packaged in Debian 10 (buster)) sends 6 digits in delay timestamps, e.g.: "2019-07-29T14:04:41.392002Z" which would result in the error Args out of range: "002Z", 4, 6 and the delayed messages would not show up at all. With this fix jabber-parse-time returns (23870 64761) as expected. --- Hi, I lost messages due to this, please consider including this fix (or something to the same effect) in jabber.el! Best regards, Adam jabber-util.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jabber-util.el b/jabber-util.el index c089dcf..74d4538 100644 --- a/jabber-util.el +++ b/jabber-util.el @@ -488,8 +488,8 @@ TIME is in a format accepted by `format-time-string'." (second (string-to-number (substring time 17 19))) ;; fractions are optional (fraction (if (eq (aref time 19) ?.) - (string-to-number (substring time 20 23)))) - (timezone (substring time (if fraction 23 19)))) + (string-to-number (substring time 20 (jabber-end-of-digits time 20))))) + (timezone (substring time (if fraction (jabber-end-of-digits time 20) 19)))) ;; timezone is either Z (UTC) or [+-]HH:MM (let ((timezone-seconds (if (string= timezone "Z") @@ -499,6 +499,13 @@ TIME is in a format accepted by `format-time-string'." (string-to-number (substring timezone 4 6)))))))) (encode-time second minute hour day month year timezone-seconds)))) +(defun jabber-end-of-digits (time pos) + "Return the first position after pos in time, that is not a +digit. This is because the fraction of seconds doesn't +necessarily have 3 digits, it might be more (like 6)." + (let ((subtime (substring time pos))) + (+ pos (string-match "[^0-9]" subtime)))) + (defun jabber-report-success (jc xml-data context) "IQ callback reporting success or failure of the operation. CONTEXT is a string describing the action. -- 2.22.0 -- "There are forty people in the world and five of them Adam Sjøgren are hamburgers." as...@ko... |
From: Adam S. <as...@ko...> - 2019-04-15 14:38:27
|
Adam Sjøgren writes: > The only thing I haven't been able to figure out is that I get a > multibyte HTTP request error the second time I call > jabber-http-file-upload - so I can send one image, then I have to > restart Emacs to send another. Which is kind of annoying. I have found the cause of this. For some reason the variable "mime" is multibyte after the first invocation, and it is used to set the extra-header "Content-Type", but in url-http the "request" then gets upgraded to multibyte, and the error ensues. This fixes it: --- a/jabber-http-file-upload.el +++ b/jabber-http-file-upload.el @@ -69,7 +69,7 @@ (defun jabber-http-file-upload-request-cb (jc xml-data data) (message "call jabber-http-file-upload-request-cb") - (let* ((mime (plist-get data :mime)) + (let* ((mime (string-to-unibyte (plist-get data :mime))) (file (plist-get data :file)) (put (nth 1 (cdar (jabber-xml-get-children (jabber-iq-query xml-data) 'put)))) (All changes on https://koldfront.dk/git/jabber-http-file-upload/) I have now reached "inline images in jabber.el"-nirvana. Easter vacation joy! Best regards, Adam -- "Everything needs to change. Adam Sjøgren And it has to start today." as...@ko... |
From: Adam S. <as...@ko...> - 2019-04-14 22:09:23
|
Adam Sjøgren writes: > Both Conversations and Gajim (with the Url Image preview-plugin) support > sending images, by way of XEP-0363, displaying the image inlne in the > chat. > I found https://github.com/yuchangyuan/jabber-http-file-upload but it > doesn't work for me, it just keeps prompting for files. I've hacked away on this library a bit, so now prompting for a file works for me, discovery of the http-upload service works for me, and the uploaded image is sent as a jabber:x:oob url-message, so Conversations, Gajim et al will show it inline. With the patch I sent yesterday ("[PATCH UPDATED] Add jabber-chat-print-image to body-printers, move jb-print-url too"), the image sent is also displayed inline in jabber.el. The only thing I haven't been able to figure out is that I get a multibyte HTTP request error the second time I call jabber-http-file-upload - so I can send one image, then I have to restart Emacs to send another. Which is kind of annoying. I can't figure the reason out. If anyone can, it would be great. Here are my changes: · https://koldfront.dk/git/jabber-http-file-upload/ I hope they can be useful to someone. I rather like being able to send images inline in jabber.el, so I don't have to resort to centralized non-XMPP services just to send a picture! Best regards, Adam -- "Everything needs to change. Adam Sjøgren And it has to start today." as...@ko... |
From: Mandar M. <man...@gm...> - 2019-04-14 19:58:41
|
Martin Jambor wrote (Sat, Apr 13, 2019 at 08:59:55PM +0200): > Thanks for the tip, this vcard then always actually displayed the > contact's proper name and so I finally knew who they were. I then > manually edited the contact (with jabber-roster-edit-action-at-point, > or just pressing "e") and changed the name to the proper one. I > usually had to do it twice for the change to take effect but I was > able to fix the five or six contacts that were un-decipherable strings > before I read your email. > > So thanks a lot, I hope you'll also be able to fix the problem too. Thank you, in turn! Your recipe worked very well for me. And yes, I had to edit each contact twice too. Best, Mandar. |
From: Adam S. <as...@ko...> - 2019-04-14 10:00:50
|
>From c7fd762d410dd0fcb13919eff56dbde115166c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Sj=C3=B8gren?= <as...@ko...> Date: Sun, 14 Apr 2019 11:48:34 +0200 Subject: To use: (require 'jabber-print-html) --- This is the work done by Phil Groce back in 2016 with my kludges to make it work nicely (remove whitespace around the rendered text, advertise XHTML rendering, use same logic as jabber-chat.el for finding html node and returning foundp). jabber-print-html.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 jabber-print-html.el diff --git a/jabber-print-html.el b/jabber-print-html.el new file mode 100644 index 0000000..fbfae94 --- /dev/null +++ b/jabber-print-html.el @@ -0,0 +1,26 @@ +(defun jabber-print-html (xml-data who mode) + "Print messages formatted in HTML, using shr." + (let ((foundp nil)) + (dolist (x (jabber-xml-node-children xml-data)) + (when (and (listp x) (eq (jabber-xml-node-name x) 'html)) + (setq foundp t) + + (when (eql mode :insert) + (when x + (let ((beg (point)) + (end nil)) + (insert (jabber-sexp2xml x)) + (setq end (point)) + (shr-render-region beg end) + (goto-char beg) + (delete-region (point) (progn (skip-chars-forward " \t\r\n") (point))) + (search-forward "---\n") + (goto-char (match-beginning 0)) + (delete-region (point) (progn (skip-chars-backward " \t\r\n") (point))) + ))))) + foundp)) + +(add-to-list 'jabber-body-printers 'jabber-print-html) +(jabber-disco-advertise-feature "http://jabber.org/protocol/xhtml-im") + +(provide 'jabber-print-html) -- 2.20.1 -- "Everything needs to change. Adam Sjøgren And it has to start today." as...@ko... |
From: Adam S. <as...@ko...> - 2019-04-14 08:41:55
|
If a jabber:x:oob message is received with a URL that looks like an image, the image is fetched and displayed. If it can't be displayed, Image: url is shown instead. I'm not quite sure about moving jabber-char-print-url to jabber-body-printers, but I don't think it makes sense to show it if displaying the image succeeds. However, if there is a URL, that can't be displayed, maybe the body should be shown? Hm. In the examples I've seen, the message looks like: <message from="vi...@ko.../pidgin" to="as...@ko..." type="chat" id="purple4fb6fb94"> <archived by="koldfront.dk" xmlns="urn:xmpp:mam:tmp" id="1555194815542627"/> <stanza-id by="koldfront.dk" xmlns="urn:xmpp:sid:0" id="1555194815542627"/> <body>https://koldfront.dk/xmpp/virgil/8ze1C6CGD1hvWQhbl4cYNzDYrAb19wjbFX7IkXZ3/x-face.png</body> <x xmlns="jabber:x:oob"> <url>https://koldfront.dk/xmpp/virgil/8ze1C6CGD1hvWQhbl4cYNzDYrAb19wjbFX7IkXZ3/x-face.png</url> </x> </message> So the body is redundant when the jabber:x:oob url is handled. --- I have updated the patch to handle errors when fetching/creating the image, it will now properly display Image: url, and I have added the max-width and max-height as customizable values. Also, webp is now in the regex. jabber-chat.el | 60 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/jabber-chat.el b/jabber-chat.el index e2fd607..60e91f7 100644 --- a/jabber-chat.el +++ b/jabber-chat.el @@ -139,6 +139,16 @@ These fields are available: :type 'string :group 'jabber-chat) +(defcustom jabber-chat-image-max-width 800 + "The maximum width of images shown in chats." + :type 'integer + :group 'jabber-chat) + +(defcustom jabber-chat-image-max-height 400 + "The maximum height of images shown in chats." + :type 'integer + :group 'jabber-chat) + (defface jabber-chat-prompt-local '((t (:foreground "blue" :weight bold))) "face for displaying the chat prompt for what you type in" @@ -177,7 +187,6 @@ These fields are available: (defvar jabber-chat-printers '(jabber-chat-print-subject jabber-chat-print-body - jabber-chat-print-url jabber-chat-goto-address) "List of functions that may be able to print part of a message. Each function receives these arguments: @@ -187,7 +196,9 @@ WHO :local or :foreign, for sent or received stanza, respectively MODE :insert or :printp. For :insert, insert text at point. For :printp, return non-nil if function would insert text.") -(defvar jabber-body-printers '(jabber-chat-normal-body) +(defvar jabber-body-printers '(jabber-chat-print-image + jabber-chat-print-url + jabber-chat-normal-body) "List of functions that may be able to print a body for a message. Each function receives these arguments: @@ -630,6 +641,51 @@ If DONT-PRINT-NICK-P is true, don't include nickname." (format "%s <%s>" desc url)))))) foundp)) +(defun jabber-chat-download-image (url) + "Download image from URL and return as image" + ;;; Maybe do a HEAD request and check Content-Type: instead? + (when (string-match "^https?://.*\\.\\(png\\|jpg\\|jpeg\\|gif\\|webp\\)$" url) + (condition-case nil + (let ((image-buffer (url-retrieve-synchronously url))) + (when image-buffer + (with-current-buffer image-buffer + (goto-char (point-min)) + (re-search-forward "^$" nil 'move) + (forward-char) + (delete-region (point-min) (point)) + (let ((image (create-image (buffer-string) nil t :max-width jabber-chat-image-max-width :max-height jabber-chat-image-max-height))) + ; I can't figure out how to use max-width and max-height, + ; as width and height are set, and overrides them: + (let ((width (image-property image :width)) + (height (image-property image :height))) + (setf (image-property image :width) nil) + (setf (image-property image width) nil) + (setf (image-property image :height) nil) + (setf (image-property image height) nil)) + image)))) + (error nil)))) + +(defun jabber-chat-print-image (xml-data who mode) + "Print images provided in jabber:x:oob namespace." + (let ((foundp nil)) + (dolist (x (jabber-xml-node-children xml-data)) + (when (and (listp x) (eq (jabber-xml-node-name x) 'x) + (string= (jabber-xml-get-attribute x 'xmlns) "jabber:x:oob")) + (setq foundp t) + + (when (eql mode :insert) + (let ((url (car (jabber-xml-node-children + (car (jabber-xml-get-children x 'url)))))) + (let ((image (jabber-chat-download-image url))) + (if image + (progn + (insert-image image url) + (insert "\n")) + (insert (jabber-propertize + "Image: " 'face 'jabber-chat-prompt-system) + url))))))) + foundp)) + (defun jabber-chat-goto-address (xml-data who mode) "Call `goto-address' on the newly written text." (when (eq mode :insert) -- 2.20.1 -- "Everything needs to change. Adam Sjøgren And it has to start today." as...@ko... |