Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Generalizations for notifications #174

Conversation

alexjgriffith
Copy link
Collaborator

Generalizations of mastodon-tl--toot and mastodon-tl--byline that allow them to be used to render notifications.

Three new arguments are added to mastodon-tl--toot

  1. body: appears above the byline
  2. author-byline, a functions that defines how the author should be rendered and that defaults to mastodon-tl--byline-author
  3. action-byline, a functions that defines how the action should be rendered. Actions include boosting, following, mentioned etc. It defaults to mastodon-tl--byline-boosted

I also removed the redundant removal of newlines in mastodon-tl--timeline

@ghost ghost assigned alexjgriffith Mar 6, 2018
@ghost ghost added the review label Mar 6, 2018
@alexjgriffith alexjgriffith changed the base branch from master to develop March 6, 2018 07:20
@alexjgriffith alexjgriffith force-pushed the generalizations-for-notifications branch from 40aa648 to 8c7f50a Compare March 6, 2018 07:47
"Generate byline for TOOT.

AUTHOR-BYLINE is function for adding the author portion of
the byline that takes one variable. By default it is `mastodon-tl--byline-author'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By defaultis now meaningless.

@@ -483,26 +489,39 @@ message is a link which unhides/hides the main body."
(mastodon-tl--render-text content)
(mastodon-tl--media toot))))

(defun mastodon-tl--toot (toot)
"Display TOOT content and byline."
(defun mastodon-tl--insert (toot body author-byline action-byline)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mastodon-tl--insert is too generic name.
If this going to be more generic than just inserting toots, we should come up with a good name for this generic "something" and then also rename the toot argument and fix the doc comment to not say toot.

"Display toot content and byline.

BODY will form the section of the toot above the byline.
AUTHOR-BYLINE and ACTION-BYLINE are optional functions that are passed to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the optional bits.

@alexjgriffith alexjgriffith force-pushed the generalizations-for-notifications branch from 664f85a to 3a1454b Compare March 7, 2018 23:49
- Made generalizations to toot and bylines to enable notifications.
- Fixed tl tests to account for the new function arguments.
- fixed whitespace
@alexjgriffith alexjgriffith merged commit e6ef8f5 into mooseyboots:develop Mar 8, 2018
@ghost ghost removed the review label Mar 8, 2018
@alexjgriffith alexjgriffith deleted the generalizations-for-notifications branch March 10, 2018 16:54
jdenen pushed a commit that referenced this pull request Aug 10, 2018
* Added generalizations needed for adding notifications #37

- Made generalizations to toot and bylines to enable notifications.
- Fixed tl tests to account for the new function arguments.
- fixed whitespace
jdenen pushed a commit that referenced this pull request Aug 11, 2018
* Added generalizations needed for adding notifications #37

- Made generalizations to toot and bylines to enable notifications.
- Fixed tl tests to account for the new function arguments.
- fixed whitespace
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants