* mixi-atom.el: Fix expressions of the copyright notices.
[elisp/mixi.git] / sb-mixi.el
index 8a6234f..56375ed 100644 (file)
@@ -1,6 +1,6 @@
 ;;; sb-mixi.el --- shimbun backend for mixi
 
 ;;; sb-mixi.el --- shimbun backend for mixi
 
-;; Copyright (C) 2006 OHASHI Akira
+;; Copyright (C) 2006, 2007 OHASHI Akira
 
 ;; Author: OHASHI Akira <bg66@koka-in.org>
 ;; Keywords: news
 
 ;; Author: OHASHI Akira <bg66@koka-in.org>
 ;; Keywords: news
@@ -18,9 +18,9 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, you can either send email to this
-;; program's maintainer or write to: The Free Software Foundation,
-;; Inc.; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 
 ;;; Commentary:
 
@@ -33,6 +33,8 @@
 (require 'mixi-utils)
 (require 'shimbun)
 
 (require 'mixi-utils)
 (require 'shimbun)
 
+(defconst shimbun-mixi-revision "$Revision: 1.59 $")
+
 (eval-and-compile
   (luna-define-class shimbun-mixi (shimbun) (comment-cache))
   (luna-define-internal-accessors 'shimbun-mixi))
 (eval-and-compile
   (luna-define-class shimbun-mixi (shimbun) (comment-cache))
   (luna-define-internal-accessors 'shimbun-mixi))
@@ -41,6 +43,7 @@
   '(("new-diaries" . mixi-get-new-diaries)
     ("new-comments" . mixi-get-new-comments)
     ("new-bbses" . mixi-get-new-bbses)
   '(("new-diaries" . mixi-get-new-diaries)
     ("new-comments" . mixi-get-new-comments)
     ("new-bbses" . mixi-get-new-bbses)
+    ("new-bbs-comments" . mixi-get-new-bbs-comments)
     ("messages" . mixi-get-messages)
     ("messages.sent" .
      (lambda (range)
     ("messages" . mixi-get-messages)
     ("messages.sent" .
      (lambda (range)
 (defcustom shimbun-mixi-group-alist nil
   "*An alist of mixi shimbun group definition.
 Each element looks like (NAME . URL) or (NAME . FUNCTION).
 (defcustom shimbun-mixi-group-alist nil
   "*An alist of mixi shimbun group definition.
 Each element looks like (NAME . URL) or (NAME . FUNCTION).
-NAME is a shimbun group name.
+NAME is a shimbun group name that you can name it as you like.
 URL is the URL for mixi access point of the group.  If URL is friend's, get
 his/her diaries as article.  If community's, get its BBSes.  If diary's or
 BBS's, get its comments.
 URL is the URL for mixi access point of the group.  If URL is friend's, get
 his/her diaries as article.  If community's, get its BBSes.  If diary's or
 BBS's, get its comments.
@@ -111,12 +114,12 @@ of mixi object."
   :type '(repeat (cons :fromat "%v"
                       (string :tag "Group name")
                       (radio (string :tag "URL")
   :type '(repeat (cons :fromat "%v"
                       (string :tag "Group name")
                       (radio (string :tag "URL")
-                             (const :tag "New diaries" mixi-get-new-diaries)
-                             (const :tag "New comments" mixi-get-new-comments)
-                             (const :tag "New BBSes" mixi-get-new-bbses)
-                             (const :tag "Messages" mixi-get-messages)
-                             (const :tag "Logs" mixi-get-logs)
-                             (function :tag "Other function")))))
+                             (function :tag "Function")))))
+
+(defcustom shimbun-mixi-get-profile-with-diary t
+  "*If non-nil, get his/her profile together with diaries."
+  :group 'shimbun
+  :type 'boolean)
 
 ;; FIXME: Don't use this user option.
 (defcustom shimbun-mixi-page-articles 10
 
 ;; FIXME: Don't use this user option.
 (defcustom shimbun-mixi-page-articles 10
@@ -154,6 +157,11 @@ of mixi object."
     (catch 'stop
       (while objects
        (let ((object (car objects)))
     (catch 'stop
       (while objects
        (let ((object (car objects)))
+         (when (and shimbun-mixi-get-profile-with-diary
+                    (mixi-diary-p object))
+           (let ((owner (mixi-diary-owner object)))
+             (unless (mixi-object-realized-p owner)
+               (mixi-realize-friend owner))))
          (when (mixi-parent-p object)
            (let* ((comments (mixi-get-comments object range))
                   (comment-headers (shimbun-mixi-get-headers shimbun
          (when (mixi-parent-p object)
            (let* ((comments (mixi-get-comments object range))
                   (comment-headers (shimbun-mixi-get-headers shimbun
@@ -192,7 +200,9 @@ of mixi object."
                                         &optional range)
   (let ((url-or-function (cdr (assoc (shimbun-current-group-internal shimbun)
                                     (shimbun-mixi-group-alist))))
                                         &optional range)
   (let ((url-or-function (cdr (assoc (shimbun-current-group-internal shimbun)
                                     (shimbun-mixi-group-alist))))
-       (range (when (integerp range) (* range shimbun-mixi-page-articles))))
+       (range (shimbun-header-index-pages range)))
+    (when (integerp range)
+      (setq range (* range shimbun-mixi-page-articles)))
     (shimbun-sort-headers
      (shimbun-mixi-get-headers shimbun
                               (mixi-make-objects url-or-function range)
     (shimbun-sort-headers
      (shimbun-mixi-get-headers shimbun
                               (mixi-make-objects url-or-function range)