Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Direct message from Statuses #7089

Conversation

ThisIsMissEm
Copy link
Contributor

Implements the ability to send the author of a status a direct message from the menu on a Status.

Currently does not carry through the context to the compose form (i.e., it's just like direct messaging from the user profiles), I'm not sure if it should actually do a "direct reply" instead, the user intent is a little vague here.

Also changes the "mention" functionality to default back to "public" if it's on "direct" — this is potentially contentious.

screen shot 2018-04-09 at 3 15 12 pm

screen shot 2018-04-09 at 3 15 00 pm

map.set('focusDate', new Date());
map.set('idempotencyKey', uuid());

if (map.get('privacy') === 'direct') {
Copy link
Member

Choose a reason for hiding this comment

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

Don't do this. Sometimes I reply to multiple people and instead of typing their names, I would use the dropdown option to mention them. This does not mess with the type of message I'm composing. If it turned my DM into a public message without me noticing/expecting it that would be really bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hence the reason I said it might be contentious — wasn't sure if that behaviour was desired.

I'll remove this change, but keep the one for the correct insertion of mentions.

Previously clicking "direct message" followed by "mention" resulted in the composed status staying as "direct", along with weird spacing of items in the text area. This attempts to fix that.
@ThisIsMissEm ThisIsMissEm force-pushed the feature/direct-message-from-statuses branch from 7558506 to 7703a13 Compare April 9, 2018 13:52
.set('focusDate', new Date())
.set('idempotencyKey', uuid());
return state.withMutations(map => {
map.update('text', text => [text.trim(), `@${action.account.get('acct')} `].filter((str) => str.length !== 0).join(' '));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This correctly spaces text in the compose area, previously you'd end up with:
"Started writing something" -> "Started writing something@gargron "

Now you'll always get: "Started writing something @gargron "

map.set('privacy', 'direct');
map.set('focusDate', new Date());
map.set('idempotencyKey', uuid());
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using withMutations to reduce changes to the state immutable map. See: https://facebook.github.io/immutable-js/docs/#/Map/withMutations

.set('focusDate', new Date())
.set('idempotencyKey', uuid());
return state.withMutations(map => {
map.update('text', text => [text.trim(), `@${action.account.get('acct')} `].filter((str) => str.length !== 0).join(' '));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This now has the same behaviour as compose mention, however, I think we should just ask whether the user wants to replace the text if they're clicking on the menu for "direct message"

@ThisIsMissEm
Copy link
Contributor Author

@Gargron submitted changes 👍

@Gargron Gargron merged commit 904a247 into mastodon:master Apr 9, 2018
@ThisIsMissEm ThisIsMissEm deleted the feature/direct-message-from-statuses branch April 9, 2018 15:16
mayaeh added a commit to mayaeh/mastodon that referenced this pull request Apr 11, 2018
ykzts pushed a commit that referenced this pull request Apr 13, 2018
* Update Japanese translations.

* Update Japanese translations.

* Update Japanese translations.

* Update Japanese translations.

* Add Japanese translations for #6984, #7040, #7072.
Update Japanese translations for privacy policy.

* Add Japanese translations for #7032, #7074, #7089.

* Proofreading Japanese translations for privacy policy.
Gargron pushed a commit that referenced this pull request May 21, 2018
* i18n: (zh-CN) #7532

* i18n: (zh-CN) #6984

* i18n: (zh-CN) #7391, #7507

* i18n: (zh-CN) #6998

* i18n: (zh-CN) #7074

* i18n: (zh-CN) #7000, #7032, #7131 (#7032, #7040)

* i18n: (zh-CN) #7130, #7188

* i18n: (zh-CN) #6486

* i18n: (zh-CN) #6292

* i18n: (zh-CN) #7347

* i18n: (zh-CN) #6661

* i18n: (zh-CN) #6425

* i18n: (zh-CN) #6597

* i18n: (zh-CN) #6695

* i18n: (zh-CN) #6325

* i18n: (zh-CN) #6460, #7375

* i18n: (zh-CN) #6872

* i18n: (zh-CN) #6818

* i18n: (zh-CN) #7452

* i18n: (zh-CN) #7176

* i18n: (zh-CN) #6460

* i18n: (zh-CN) #7213

* i18n: (zh-CN) #7376

* i18n: (zh-CN) #6556

* i18n: (zh-CN) #6645

* i18n: (zh-CN) #6448

* i18n: (zh-CN) #5303

* i18n: (zh-CN) #7445

* i18n: (zh-CN) Normalization and improvements

* i18n: (zh-CN) #7391

* i18n: (zh-CN) #6627

* i18n: (zh-CN) #6956, #7546

* i18n: (zh-CN) #6636

* i18n: (zh-CN) #6610, #6875

* i18n: (zh-CN) #6887

* i18n: (zh-CN) #4514

* i18n: (zh-CN) #6628

* i18n: (zh-CN) #6771

* i18n: (zh-CN) #6772

* i18n: (zh-CN) #7178

* i18n: (zh-CN) #7521

* i18n: (zh-CN) #6570

* i18n: (zh-CN) #6593

* i18n: (zh-CN) #6423

* i18n: (zh-CN) #6157

* i18n: (zh-CN) #7089

* i18n: (zh-CN) #6733

* i18n: (zh-CN) #7072

* i18n: (zh-CN) #6520

* i18n: (zh-CN) Improvment

* i18n: (zh-CN) #6631
chendo pushed a commit to assemblyfour/switter that referenced this pull request May 28, 2018
* Fix: Switching between composing direct message and mention from menus

Previously clicking "direct message" followed by "mention" resulted in the composed status staying as "direct", along with weird spacing of items in the text area. This attempts to fix that.

* Fix: Add missing proptype check for onMention in Status component

* Add the ability to send a direct message to a user from the menu on Statuses

* Add space between "Embed" and "Mention" on expanded statuses menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants