Skip to content
This repository
Browse code

Messages is retrieved and showed! :)

Use `diaspora-message` to see your private conversation's messages! :)
  • Loading branch information...
commit 348046d5de6b6291b03de16b4e73e44cb52069cb 1 parent b40d88d
Christian Giménez authored

Showing 2 changed files with 20 additions and 6 deletions. Show diff stats Hide diff stats

  1. +19 5 diaspora-messages.el
  2. +1 1  diaspora-stream.el
24 diaspora-messages.el
@@ -49,8 +49,8 @@
49 49 ;;
50 50 ;;; Code:
51 51
52   -(require 'diaspora)
53 52 (require 'diaspora-urls)
  53 +(require 'htmlr)
54 54
55 55 (defconst diaspora-messages-buffer-name "*Diaspora Messages*"
56 56 "This is the buffer-name of the diaspora messages list.")
@@ -168,16 +168,19 @@ Use it for getting the nearest id post number when selecting a message."
168 168 (text nil)
169 169 )
170 170 (with-current-buffer (diaspora-get-url (diaspora-messages-url msg-id))
171   - (diaspora-delete-http-header)
172   - (diaspora-message-delete-unnecessary)
173   - (setq text (buffer-string))
  171 + (let ((buffer-file-coding-system 'utf-8))
  172 + (diaspora-delete-http-header)
  173 + (diaspora-message-delete-unnecessary)
  174 + (diaspora-message-replace-necessary)
  175 + (setq text (buffer-string))
  176 + )
174 177 )
175 178 (with-current-buffer buffer-to
176 179 (let ((inhibit-read-only t)
177 180 (buffer-file-coding-system 'utf-8)
178 181 )
179 182 (delete-region (point-min) (point-max))
180   - (insert text)
  183 + (insert (string-as-multibyte text))
181 184 (goto-char (point-min))
182 185 (htmlr-render)
183 186 (goto-char (point-min))
@@ -197,6 +200,17 @@ Use it for getting the nearest id post number when selecting a message."
197 200 )
198 201 )
199 202
  203 +(defun diaspora-message-replace-necessary ()
  204 + "Replace text so you can see the message in a better way."
  205 + (save-excursion
  206 + (goto-char (point-min))
  207 + (while (search-forward "<div class='ltr'>" nil t)
  208 + (goto-char (match-end 0))
  209 + (insert "\n<hr />\n")
  210 + )
  211 + )
  212 + )
  213 +
200 214
201 215 (provide 'diaspora-messages)
202 216 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2  diaspora-stream.el
@@ -1001,7 +1001,7 @@ The tag must be a string without the starting \"#\"."
1001 1001 (let ((url-request-extra-headers
1002 1002 '(("Content-Type" . "application/x-www-form-urlencoded")
1003 1003 ("Accept-Language" . "en")
1004   - ("Accept-Charset" . "UTF-8")))
  1004 + ("Accept-Charset" . "utf-8")))
1005 1005 (buffer-file-coding-system 'utf-8)
1006 1006 )
1007 1007 (url-retrieve-synchronously url)))

0 comments on commit 348046d

Please sign in to comment.
Something went wrong with that request. Please try again.