;; 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
(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)))))