Skip to content

Commit

Permalink
add class slack-shared-message
Browse files Browse the repository at this point in the history
  • Loading branch information
yuya373 committed Sep 24, 2016
1 parent 6f4e823 commit fb9967b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions slack-message.el
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,15 @@
(author-icon :initarg :author_icon)
(fields :initarg :fields :type (or null list))
(image-url :initarg :image_url)
(thumb-url :initarg :thumb_url)))
(thumb-url :initarg :thumb_url)
(is-share :initarg :is_share :initform nil)))

(defclass slack-shared-message (slack-attachment)
((ts :initarg :ts :initform nil)
(color :initarg :color :initform nil)
(channel-id :initarg :channel_id :initform nil)
(channel-name :initarg :channel_name :initform nil)
(from-url :initarg :from_url :initform nil)))

(defgeneric slack-message-sender-name (slack-message team))
(defgeneric slack-message-to-string (slack-message))
Expand Down Expand Up @@ -119,8 +127,11 @@
(defun slack-attachment-create (payload)
(plist-put payload :fields
(append (plist-get payload :fields) nil))
(apply #'slack-attachment "attachment"
(slack-collect-slots 'slack-attachment payload)))
(if (plist-get payload :is_share)
(apply #'slack-shared-message "shared-attachment"
(slack-collect-slots 'slack-shared-message payload))
(apply #'slack-attachment "attachment"
(slack-collect-slots 'slack-attachment payload))))

(defmethod slack-message-set-attachments ((m slack-message) payload)
(let ((attachments (plist-get payload :attachments)))
Expand Down

0 comments on commit fb9967b

Please sign in to comment.