Compare commits

..

No commits in common. "b687c355d06eba270516fc1015f7d2da70817b78" and "e428288f2f456b5e05fc26f9774a6b58b9486bc4" have entirely different histories.

8 changed files with 69 additions and 62 deletions

View file

@ -64,27 +64,25 @@ const ChatMessage = {
Timeago,
},
computed: {
isMessage() {
return this.chatItem.type === 'message'
},
message() {
if (!this.isMessage) return null
return this.chatItem.data.retweeted_status ?? this.chatItem.data
},
isStatus() {
// ChatMessage only has account_id while Status has full user data
return !!this.message.user
},
author() {
const accountId = this.isStatus ? this.message.user.id : this.message.account_id
const accountId = this.message.account_id || this.message.user.id
return this.$store.getters.findUser(accountId)
},
isCurrentUser() {
return this.author.id === this.currentUser.id
},
// Reply stuff
message() {
if (!this.isMessage) return null
return this.chatItem.data.retweeted_status ?? this.chatItem.data
},
isMessage() {
return this.chatItem.type === 'message'
},
isCustomReply() {
if (!this.previousItem) return false
if (!this.message.in_reply_to_status_id) return false
@ -118,8 +116,6 @@ const ChatMessage = {
return user ? user.statusnet_profile_url : 'NOT_FOUND'
}
},
// Quote stuff
quoteId() {
return this.message.quote_id
},
@ -129,8 +125,6 @@ const ChatMessage = {
quoteVisible() {
return this.message.quote_visible
},
// Content
messageForStatusContent() {
return {
...this.message,
@ -143,8 +137,6 @@ const ChatMessage = {
hasAttachment() {
return this.message.attachments.length > 0
},
// Stylistic
classnames() {
return {
'-outgoing': this.isCurrentUser,
@ -153,15 +145,6 @@ const ChatMessage = {
'-focused': this.focused,
}
},
popoverMarginStyle() {
if (this.isCurrentUser) {
return {}
} else {
return { left: 50 }
}
},
// Global stuff
...mapPiniaState(useInterfaceStore, {
betterShadow: (store) => store.browserSupport.cssFilter,
}),
@ -169,7 +152,14 @@ const ChatMessage = {
currentUser: (state) => state.users.currentUser,
restrictedNicknames: (state) => useInstanceStore().restrictedNicknames,
}),
...mapPiniaState(useMergedConfigStore, ['mergedConfig']),
popoverMarginStyle() {
if (this.isCurrentUser) {
return {}
} else {
return { left: 50 }
}
},
...mapPiniaState(useMergedConfigStore, ['mergedConfig', 'findUser']),
},
data() {
return {

View file

@ -145,12 +145,8 @@
:full-content="true"
>
<template #footer>
<EmojiReactions
v-if="isStatus"
:status="message"
/>
<EmojiReactions :status="message" />
<Quote
v-if="isStatus"
class="quoted-post"
:status-id="quoteId"
:status-url="quoteUrl"

View file

@ -343,8 +343,6 @@ const Chat = {
accountId: this.recipientId,
credentials: useOAuthStore().token,
})
this.$store.commit('addNewUsers', [data.account])
data.account = this.$store.getters.findUser(data.account.id)
this.chat = data
} catch (e) {
console.error('Error creating or getting a chat', e)

View file

@ -93,18 +93,38 @@
}
}
.auto-reply-to-section {
margin: 0 1em;
gap: 0.5em;
h4 {
margin: 0.5em 0;
line-height: 1.1;
button {
line-height: 1.1;
}
}
.reply-to-preview {
display: flex;
align-items: center;
gap: 0.5em;
border: 1px solid var(--border);
border-radius: var(--roundness);
padding: 0.5em;
}
}
.chat-view-reply-form {
position: sticky;
display: flex;
flex-direction: column;
align-items: stretch;
bottom: 0;
padding: 0;
}
.reply-to-text {
line-height: 1.2;
padding-top: 0.5em;
margin-bottom: -0.5em;
.reply-form form {
margin-top: 0;
}
}
}

View file

@ -219,7 +219,7 @@
class="chat-view-reply-form panel-footer -flexible-height"
>
<div class="auto-reply-to-section">
<center class="reply-to-text">
<span class="reply-to-text">
{{ explicitReplyStatus ? $t('status.reply_to_selected') : $t('status.reply_to_last') }}
<button
v-if="explicitReplyStatus"
@ -229,7 +229,7 @@
<FAIcon icon="times" />
{{ $t('general.cancel') }}
</button>
</center>
</span>
</div>
<PostStatusForm
class="reply-form"
@ -242,8 +242,6 @@
:preserve-focus="!mobileLayout"
:auto-focus="!mobileLayout"
disable-quotes
disable-lock-warning
disable-notice
mentions-line
mentions-line-read-only
@posted="onPosted"

View file

@ -1,20 +1,6 @@
.post-status-form {
position: relative;
form {
display: flex;
flex-direction: column;
padding: 0.5em;
position: relative;
gap: 0.25em;
}
.form-group {
display: flex;
flex-direction: column;
line-height: 1.85;
}
.attachments {
margin-bottom: 0.5em;
}
@ -30,6 +16,7 @@
.form-bottom {
display: flex;
justify-content: space-between;
padding: 0.5em 0.5em 0.25em;
height: 2.5em;
.post-button-group {
@ -55,11 +42,11 @@
.form-bottom-left {
display: flex;
gap: 1.5em;
margin: 0 0.5em;
margin-right: 1em;
button {
padding: 0.25em;
margin: -0.25em;
padding: 0.5em;
margin: -0.5em;
}
}
@ -203,6 +190,20 @@
cursor: not-allowed;
}
form {
display: flex;
flex-direction: column;
margin: 0.6em;
position: relative;
}
.form-group {
display: flex;
flex-direction: column;
padding: 0.25em 0.5em 0.5em;
line-height: 1.85;
}
.inputs-wrapper {
padding: 0;
display: flex;
@ -211,7 +212,9 @@
.keyboard-enter-hint {
text-align: right;
margin-right: 1em;
line-height: 1;
margin-bottom: 0.5em;
}
textarea.input.form-post-body {

View file

@ -74,7 +74,7 @@
</a>
</p>
<p
v-else-if="!hideScopeNotice && newStatus.visibility === 'direct'"
v-else-if="newStatus.visibility === 'direct'"
class="visibility-notice notice-dismissible"
>
<span v-if="safeDMEnabled">{{ $t('post_status.direct_warning_to_first_only') }}</span>

View file

@ -39,7 +39,9 @@
}
.post-status-form {
margin: 0.5em;
form {
margin-top: 0;
}
}
.signed-in {