* riece.el (riece-create-buffers): Suppress byte-compile
[riece] / lisp / riece-channel.el
index 2536e5b..a4fc8bd 100644 (file)
@@ -19,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Code:
 
 (require 'riece-globals)
 (require 'riece-identity)
 (require 'riece-mode)
+(require 'riece-cache)
 
 ;;; Channel object:
 (defun riece-find-channel (name)
   "Get a channel object named NAME from the server buffer."
+  (riece-cache-get riece-channel-cache name)
   (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name)
                             riece-channel-obarray)))
     (if symbol
        (symbol-value symbol))))
 
 (defun riece-forget-channel (name)
+  (riece-cache-delete riece-channel-cache name)
   (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name)
                             riece-channel-obarray)))
     (when symbol
@@ -55,7 +58,10 @@ respectively."
   (let ((symbol (intern-soft (riece-identity-canonicalize-prefix name)
                             riece-channel-obarray)))
     (if symbol
-       (symbol-value symbol)
+       (progn
+         (riece-cache-get riece-channel-cache name)
+         (symbol-value symbol))
+      (riece-cache-set riece-channel-cache name name)
       (set (intern (riece-identity-canonicalize-prefix name)
                   riece-channel-obarray)
           (riece-make-channel nil nil nil nil nil nil nil)))))