-(defun riece-concat-modes (target string)
- (let ((modes
- (if (riece-channel-p target)
- (riece-channel-get-modes target)
- (riece-user-get-modes target))))
- (if modes
- (concat string " [" (apply #'string modes) "]")
- string)))
-
-(defsubst riece-concat-current-channel-modes (string)
- (if riece-current-channel
- (riece-concat-modes riece-current-channel string)
- string))
+(defun riece-concat-channel-topic (target string)
+ (riece-with-server-buffer (riece-identity-server target)
+ (let ((topic (riece-channel-get-topic (riece-identity-prefix target))))
+ (if (or (null topic)
+ (equal topic ""))
+ string
+ (concat string ": " topic)))))
+
+(defun riece-concat-channel-modes (target string)
+ (riece-with-server-buffer (riece-identity-server target)
+ (let ((modes (riece-channel-get-modes (riece-identity-prefix target))))
+ (if modes
+ (concat string " [" (apply #'string modes) "]")
+ string))))