;ELC   
;;; Compiled
;;; in Emacs version 29.3
;;; with all optimizations.



(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\207" [require cl-lib map notifications ement-lib ement-room] 2)#@41 Whether D-Bus notifications are usable.
(defvar ement-notify-dbus-p (byte-code "\301\302!\205- \303\304\305\306#\205- \3071 \310\311!0\202% \205# \312@A\"\262\205- \313\311\314\315#\207" [dbus-debug featurep dbusbind require dbus nil :no-error (dbus-error) dbus-get-unique-name :session signal dbus-ping "org.freedesktop.Notifications" 2000] 4) (#$ . 221))
(byte-code "\300\301\302\303\304\305%\210\306\307\310\311\312DD\313\314\315%\210\306\316\310\311\317DD\320\314\321\322\323&\210\306\324\310\311\325DD\326\314\321\322\327&\210\306\330\310\311\331DD\332\314\321\322\333&\210\306\334\310\311\335DD\336\314\321\322\337&\210\306\340\310\311\341DD\342\314\343%\210\306\344\310\311\345DD\346\314\347%\210\306\350\310\311\351DD\352\314\353%\210\306\354\310\311\355DD\356\314\353%\207" [custom-declare-group ement-notify nil "Notification options." :group ement custom-declare-variable ement-notify-ignore-predicates funcall function #[0 "\300\207" [(ement-notify--event-not-message-p ement-notify--event-from-session-user-p)] 1 #1=""] "Display notification if none of these return non-nil for an event.\nEach predicate is called with three arguments: the event, the\nroom, and the session (each the respective struct)." :type (repeat (choice (function-item ement-notify--event-not-message-p) (function-item ement-notify--event-from-session-user-p) (function :tag "Custom predicate"))) ement-notify-log-predicates #[0 "\300\207" [(ement-notify--event-mentions-session-user-p ement-notify--event-mentions-room-p ement-notify--room-buffer-live-p ement-notify--room-unread-p)] 1 #1#] "Predicates to determine whether to log an event to the notifications buffer.\nIf one of these returns non-nil for an event, the event is logged." hook :options (ement-notify--event-mentions-session-user-p ement-notify--event-mentions-room-p ement-notify--room-buffer-live-p ement-notify--room-unread-p) ement-notify-mark-frame-urgent-predicates #[0 "\300\207" [(ement-notify--event-mentions-session-user-p ement-notify--event-mentions-room-p)] 1 #1#] "Predicates to determine whether to mark a frame as urgent.\nIf one of these returns non-nil for an event, the frame that most\nrecently showed the event's room's buffer is marked\nurgent.  (Only works on X, not other GUI platforms.)" (ement-notify--event-mentions-session-user-p ement-notify--event-mentions-room-p) ement-notify-mention-predicates #[0 "\300\207" [(ement-notify--event-mentions-session-user-p ement-notify--event-mentions-room-p)] 1 #1#] "Predicates to determine whether to log an event to the mentions buffer.\nIf one of these returns non-nil for an event, the event is logged." (ement-notify--event-mentions-session-user-p ement-notify--event-mentions-room-p) ement-notify-notification-predicates #[0 "\300\207" [(ement-notify--event-mentions-session-user-p ement-notify--event-mentions-room-p ement-notify--room-buffer-live-p ement-notify--room-unread-p)] 1 #1#] "Predicates to determine whether to send a desktop notification.\nIf one of these returns non-nil for an event, the notification is sent." (ement-notify--event-mentions-session-user-p ement-notify--event-mentions-room-p ement-notify--room-buffer-live-p ement-notify--room-unread-p) ement-notify-sound #[0 "\300\207" [nil] 1 #1#] "Sound to play for notifications." (choice (file :tag "Sound file") (string :tag "XDG sound name") (const :tag "Default XDG message sound" "message-new-instant") (const :tag "Don't play a sound" nil)) ement-notify-limit-room-name-width #[0 "\300\207" [nil] 1 #1#] "Limit the width of room display names in mentions and notifications buffers.\nThis prevents the margin from being made excessively wide." (choice (integer :tag "Maximum width") (const :tag "Unlimited width" nil)) ement-notify-prism-background #[0 "\300\207" [nil] 1 #1#] "Add distinct background color by room to messages in notification buffers.\nThe color is specific to each room, generated automatically, and\ncan help distinguish messages by room." boolean ement-notify-room-avatars #[0 "\300\207" [t] 1 #1#] "Show room avatars in the notifications buffers.\nThis shows room avatars at the left of the window margin in\nnotification buffers.  It's not customizable beyond that due to\nlimitations and complexities of displaying strings and images in\nmargins in Emacs.  But it's useful, anyway."] 8)#@54 Show BUTTON's event in its room buffer.

(fn BUTTON)
(defalias 'ement-notify-button-action #[257 "\300\301\"\300\302\"\300\303\"\304\"\210\305!\207" [button-get session room event ement-view-room ement-room-goto-event] 7 (#$ . 4547) nil])#@33 Send a reply to event at point.
(defalias 'ement-notify-reply #[0 "\300 \301\302\"\216\303 \210\304\305!)\207" [current-window-configuration make-closure #[0 "\301\300!\207" [V0 set-window-configuration] 2] push-button call-interactively ement-room-write-reply] 4 (#$ . 4797) nil])#@43 Switch to "*Ement Notifications*" buffer.
(defalias 'ement-notify-switch-to-notifications-buffer #[0 "\300\301!\207" [call-interactively ement-notifications] 2 (#$ . 5085) nil])#@38 Switch to "*Ement Mentions*" buffer.
(defalias 'ement-notify-switch-to-mentions-buffer #[0 "\301\302\303\304\"!\210\305!\306\307\310#\210\306\311\310#\210\312!\207" [ement-notifications-mode-map switch-to-buffer ement-notifications--log-buffer :name "*Ement Mentions*" copy-keymap define-key [remap scroll-down-command] nil [remap mwheel-scroll] use-local-map] 5 (#$ . 5268) nil])#@198 Send notifications for EVENT in ROOM on SESSION.
Sends if all of `ement-notify-ignore-predicates' return nil.
Does not do anything if session hasn't finished initial sync.

(fn EVENT ROOM SESSION)
(defalias 'ement-notify #[771 "\3031\206 \304!>\204 \305\306\307D\"\210\211\310H\205\204 	\311\312:\203; @\262#?\211\262\203; A\262\202 \211??\266\203\205\204 \n\203V \313\314$\203V \315#\210\313\316$\203e \317#\210\313\320$\203v \317\321\322%\210\313\323$\205\204 \324#0\207\325\326\"\210\311\207" [cl-struct-ement-session-tags ement-notify-ignore-predicates ement-notify-dbus-p (debug error) type-of signal wrong-type-argument ement-session 9 nil t run-hook-with-args-until-success ement-notify-notification-predicates ement-notify--notifications-notify ement-notify-log-predicates ement-notify--log-to-buffer ement-notify-mention-predicates :buffer-name "*Ement Mentions*" ement-notify-mark-frame-urgent-predicates ement-notify--mark-frame-urgent message "ement-notify: Error: %S"] 10 (#$ . 5659)])#@114 Mark frame showing ROOM's buffer as urgent.
If ROOM has no existing buffer, do nothing.

(fn EVENT ROOM SESSION)
(defalias 'ement-notify--mark-frame-urgent #[771 "\301\302\303\304!>\204 \305\306\307D\"\210\310H\"\211\205@ \311 \312\211:\203< @\262\313!\314=\2035 B\262A\262\202 \211\237\266\203\211\205\\ \211G\211\315=\203Q @\202Z \316\317\320\"\"@\262\211\205c !\207" [cl-struct-ement-room-tags #[257 "\300\301\302\302\303\211\304&\305\"\211\306@\307\"\240\210\310\302\303\302\311\304&\207" [cl-coerce x-window-property "WM_HINTS" nil t list logior 256 x-change-window-property 32] 9 "\n\n(fn FRAME)"] alist-get buffer type-of signal wrong-type-argument ement-room 18 frame-list nil framep x 1 sort make-closure #[514 "\301\300\302!\"\301\300\302!\"\203 \211\203 W\207\206 \211\207" [V0 cl-position buffer-list] 7 "\n\n(fn FRAME-A FRAME-B)"]] 12 (#$ . 6707)])#@84 Call `notifications-notify' for EVENT in ROOM on SESSION.

(fn EVENT ROOM SESSION)
(defalias 'ement-notify--notifications-notify #[771 "\303!>\210\304H\305H\303!	>\210\306H\304H\307!\210\310\311\"\206( \312!\313\"\314\315#;\205v \316\317\"\210\320\321\322\323\324\325\205W \326\327\330\331\332#A\333\"!\334\335\336\337\340\n\205g \341\n!\205g \n\342\n\205t \341\n!?\205t \n&\207" [cl-struct-ement-event-tags cl-struct-ement-room-tags ement-notify-sound type-of 2 3 13 mapp map-elt body ement--room-display-name ement--user-displayname-in format "%s in %s" truncate-string-to-width 60 notifications-notify :title :body :app-name "Ement.el" :app-icon ement-notify--temp-file plist-get get-text-property 0 display :data :category "im.received" :timeout 5000 :sound-file file-name-absolute-p :sound-name] 29 (#$ . 7611)])#@104 Return a filename holding CONTENT, and delete it after TIMEOUT seconds.

(fn CONTENT &key (TIMEOUT 5))
(defalias 'ement-notify--temp-file #[385 "\301\302\"\206 \303A@\211\203@ \211@\304>\203) \211A\204! \305\306@\"\210\211AA\262\202 \307>A@\2037 \310\262\202 \305\311@\"\210\202 \210\312\313!\314\315\316\317\"\320\321\"\216r\211q\210c)\210r\211q\210\322\310\211\310\323%*\266\324\310\320\325\"#)\210\207" [coding-system-for-write plist-member :timeout (nil 5) (:timeout :allow-other-keys) error "Missing argument for %s" :allow-other-keys nil "Keyword argument %s not one of (:timeout)" make-temp-file "ement-notify--temp-file-" no-conversion generate-new-buffer " *temp file*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] write-region 0 run-at-time #[0 "\301\300!\207" [V0 delete-file] 2]] 11 (#$ . 8463)])#@133 Log EVENT in ROOM on SESSION to "*Ement Notifications*" buffer.

(fn EVENT ROOM SESSION &key (BUFFER-NAME "*Ement Notifications*"))
(defalias 'ement-notify--log-to-buffer #[899 "\301\302\"\206 \303A@\211\203@ \211@\304>\203) \211A\204! \305\306@\"\210\211AA\262\202 \307>A@\2037 \310\262\202 \305\311@\"\210\202 \210\312!>\210\313H\314\315\310$\316\302$\207" [cl-struct-ement-room-tags plist-member :buffer-name (nil "*Ement Notifications*") (:buffer-name :allow-other-keys) error "Missing argument for %s" :allow-other-keys nil "Keyword argument %s not one of (:buffer-name)" type-of 1 record ement-notification ement-notifications-log-to-buffer] 12 (#$ . 9333)])#@133 Return non-nil if EVENT in ROOM mentions SESSION's user.
If EVENT's sender is SESSION's user, returns nil.

(fn EVENT ROOM SESSION)
(defalias 'ement-notify--event-mentions-session-user-p #[771 "\303!>\210\211\304H\303!	>\210\305H\303!\n>\204! \306\307\310D\"\210\304H\303!\n>\2043 \306\307\310D\"\210\304H\232?\205A \311#\207" [cl-struct-ement-session-tags cl-struct-ement-event-tags cl-struct-ement-user-tags type-of 1 2 signal wrong-type-argument ement-user ement-room--event-mentions-user-p] 10 (#$ . 10025)])#@68 Return non-nil if ROOM has a live buffer.

(fn EVENT ROOM SESSION)
(defalias 'ement-notify--room-buffer-live-p #[771 "\301\302\303\304!>\204 \305\306\307D\"\210\310H\"!\207" [cl-struct-ement-room-tags buffer-live-p alist-get buffer type-of signal wrong-type-argument ement-room 18] 10 (#$ . 10557)])#@141 Return non-nil if ROOM has unread notifications.
According to the room's notification configuration on the server.

(fn EVENT ROOM SESSION)
(defalias 'ement-notify--room-unread-p #[771 "\301!>\210\302H\303!\210\304\305\"\304\306\"\307=\205 \211\307=?\207" [cl-struct-ement-room-tags type-of 9 mapp map-elt notification_count highlight_count 0] 8 (#$ . 10869)])#@80 Return non-nil if EVENT is an "m.room.message" event.

(fn EVENT ROOM SESSION)
(defalias 'ement-notify--event-message-p #[771 "\301!>\204 \302\303\304D\"\210\305H\306\232\207" [cl-struct-ement-event-tags type-of signal wrong-type-argument ement-event 5 "m.room.message"] 7 (#$ . 11243)])#@84 Return non-nil if EVENT is not an "m.room.message" event.

(fn EVENT ROOM SESSION)
(defalias 'ement-notify--event-not-message-p #[771 "\301!>\204 \302\303\304D\"\210\305H\306\232?\207" [cl-struct-ement-event-tags type-of signal wrong-type-argument ement-event 5 "m.room.message"] 7 (#$ . 11541)])#@77 Return non-nil if EVENT is sent by SESSION's user.

(fn EVENT ROOM SESSION)
(defalias 'ement-notify--event-from-session-user-p #[771 "\303\211!>\204 \304\305\306D\"\210\307H!	>\2042 \304\305\310\303!>\204, \304\305\306D\"\210\307HD\"\210\303!>\204A \304\305\306D\"\210\211\307H\307H\303\211!\n>\204W \304\305\311D\"\210\312H!	>\204{ \304\305\310\303!\n>\204t \304\305\311	D\"\210\312HD\"\210\303!\n>\204\213 \304\305\311D\"\210\312H\307H\232\207" [cl-struct-ement-session-tags cl-struct-ement-user-tags cl-struct-ement-event-tags type-of signal wrong-type-argument ement-session 1 ement-user ement-event 2] 11 (#$ . 11848)])
(byte-code "\300\301\302\"\210\303\304!\207" [defalias ement-notify--event-mentions-room-p ement--event-mentions-room-p require bookmark] 3)#@65 Return a bookmark record for the current `ement-notify' buffer.
(defalias 'ement-notify-bookmark-make-record #[0 "\300 \300\211 B\301\302BE\207" [buffer-name handler ement-notify-bookmark-handler] 4 (#$ . 12645)])#@62 Show Ement notifications buffer for BOOKMARK.

(fn BOOKMARK)
(defalias 'ement-notify-bookmark-handler #[257 "\211\242\243\300!\210\301\302\"\303\304\305\306\"!\207" [mapp map-elt buffer-name nil switch-to-buffer ement-notifications--log-buffer :name] 9 (#$ . 12864)])
(provide 'ement-notify)
