Skip to content

Commit

Permalink
Fix `twittering-render-timeline' not to duplicate statuses.
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-render-timeline): fix logic for
inserting statuses not to duplicate the last status.
  • Loading branch information
cvmat committed Jan 21, 2010
1 parent 2f6cf94 commit ec52650
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -3,6 +3,9 @@
* twittering-mode.el (twittering-render-timeline): reduce
redundant calls of `goto-char'.

* twittering-mode.el (twittering-render-timeline): fix logic for
inserting statuses not to duplicate the last status.

2010-01-20 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-http-get-default-sentinel): Show
Expand Down
21 changes: 7 additions & 14 deletions twittering-mode.el
Expand Up @@ -1850,20 +1850,13 @@ If STATUS-DATUM is already in DATA-VAR, return nil. If not, return t."
(let* ((id (cdr (assoc 'id status))))
;; Find where the status should be inserted.
(while
(let* ((buf-id (get-text-property pos 'id))
(next-pos (twittering-get-next-status-head pos)))
(cond
((null buf-id)
nil)
((null next-pos)
;; Failed to find the next status.
(setq pos (point-max))
nil)
((twittering-status-id< id buf-id)
(setq pos next-pos)
t)
(t
nil))))
(let* ((buf-id (get-text-property pos 'id)))
(if (and buf-id (twittering-status-id< id buf-id))
(let ((next-pos
(twittering-get-next-status-head pos)))
(setq pos (or next-pos (point-max)))
next-pos)
nil)))
(unless (twittering-status-id= id (get-text-property pos 'id))
(let ((formatted-status
(twittering-format-status
Expand Down

0 comments on commit ec52650

Please sign in to comment.