Compare commits

...

5 Commits

Author SHA1 Message Date
a0c396a842 10.19.0 2018-10-15 18:03:28 +09:00
88fbc53e37 Resolve #2314 2018-10-15 18:02:57 +09:00
a2206b2d52 🎨 2018-10-15 17:55:59 +09:00
a95ff447d7 🎨 2018-10-15 17:43:25 +09:00
49dbd7f9d2 Fix following from Preroma does not complete (#2905)
* In Follow Accept/Reject, send previous received id

* In Follow Accept/Reject, send Activity.actor
2018-10-15 16:51:22 +09:00
15 changed files with 90 additions and 18 deletions

View File

@ -1239,6 +1239,8 @@ mobile/views/components/drive.file-detail.vue:
hash: "ハッシュ (md5)"
exif: "EXIF"
nsfw: "閲覧注意"
mark-as-sensitive: "閲覧注意に設定"
unmark-as-sensitive: "閲覧注意を解除"
mobile/views/components/media-image.vue:
sensitive: "閲覧注意"

View File

@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "10.18.0",
"clientVersion": "1.0.10538",
"version": "10.19.0",
"clientVersion": "1.0.10543",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,

View File

@ -157,6 +157,9 @@ export default Vue.extend({
font-family Meiryo, sans-serif
text-decoration none
@media (max-width 1100px)
display none
[data-fa]
margin-left 8px
@ -171,6 +174,9 @@ export default Vue.extend({
border-radius 4px
transition filter 100ms ease
@media (max-width 1100px)
margin-left 8px
> .menu
$bgcolor = var(--face)
display block

View File

@ -29,6 +29,9 @@ export default Vue.extend({
<style lang="stylus" scoped>
.search
@media (max-width 800px)
display none !important
> [data-fa]
display block
position absolute
@ -58,6 +61,9 @@ export default Vue.extend({
transition color 0.5s ease, border 0.5s ease
color var(--desktopHeaderSearchFg)
@media (max-width 1000px)
width 10em
&::placeholder
color var(--desktopHeaderFg)

View File

@ -276,13 +276,24 @@ export default Vue.extend({
min-width 330px
height 100%
background var(--face)
border-radius 6px
//box-shadow 0 2px 16px rgba(#000, 0.1)
border-radius var(--round)
box-shadow var(--shadow)
overflow hidden
&.draghover
box-shadow 0 0 0 2px var(--primaryAlpha08)
&:after
content ""
display block
position absolute
z-index 1000
top 0
left 0
width 100%
height 100%
background var(--primaryAlpha02)
&.dragging
box-shadow 0 0 0 2px var(--primaryAlpha04)
@ -338,6 +349,7 @@ export default Vue.extend({
> .toggleActive
> .menu
padding 0
width $header-height
line-height $header-height
font-size 16px

View File

@ -41,6 +41,8 @@
<ui-button link :href="`${file.url}?download`" :download="file.name">%fa:download% %i18n:@download%</ui-button>
<ui-button @click="rename">%fa:pencil-alt% %i18n:@rename%</ui-button>
<ui-button @click="move">%fa:R folder-open% %i18n:@move%</ui-button>
<ui-button @click="toggleSensitive" v-if="file.isSensitive">%fa:R eye% %i18n:@unmark-as-sensitive%</ui-button>
<ui-button @click="toggleSensitive" v-else>%fa:R eye-slash% %i18n:@mark-as-sensitive%</ui-button>
<ui-button @click="del">%fa:trash-alt R% %i18n:@delete%</ui-button>
</div>
</div>
@ -71,25 +73,30 @@ import { gcd } from '../../../../../prelude/math';
export default Vue.extend({
props: ['file'],
data() {
return {
gcd,
exif: null
};
},
computed: {
browser(): any {
return this.$parent;
},
kind(): string {
return this.file.type.split('/')[0];
},
style(): any {
return this.file.properties.avgColor && this.file.properties.avgColor.length == 3 ? {
'background-color': `rgb(${ this.file.properties.avgColor.join(',') })`
} : {};
}
},
methods: {
rename() {
const name = window.prompt('%i18n:@rename%', this.file.name);
@ -101,6 +108,7 @@ export default Vue.extend({
this.browser.cf(this.file, true);
});
},
move() {
(this as any).apis.chooseDriveFolder().then(folder => {
(this as any).api('drive/files/update', {
@ -111,6 +119,7 @@ export default Vue.extend({
});
});
},
del() {
(this as any).api('drive/files/delete', {
fileId: this.file.id
@ -118,9 +127,20 @@ export default Vue.extend({
this.browser.cd(this.file.folderId, true);
});
},
toggleSensitive() {
(this as any).api('drive/files/update', {
fileId: this.file.id,
isSensitive: !this.file.isSensitive
});
this.file.isSensitive = !this.file.isSensitive;
},
showCreatedAt() {
alert(new Date(this.file.createdAt).toLocaleString());
},
onImageLoaded() {
const self = this;
EXIF.getData(this.$refs.img, function(this: any) {

View File

@ -12,6 +12,7 @@ export type IFollowRequest = {
createdAt: Date;
followeeId: mongo.ObjectID;
followerId: mongo.ObjectID;
requestId?: string; // id of Follow Activity
// 非正規化
_followee: {

View File

@ -23,5 +23,5 @@ export default async (actor: IRemoteUser, activity: IFollow): Promise<void> => {
throw new Error('フォローしようとしているユーザーはローカルユーザーではありません');
}
await follow(actor, followee);
await follow(actor, followee, activity.id);
};

View File

@ -1,4 +1,8 @@
export default (object: any) => ({
import config from '../../../config';
import { ILocalUser } from '../../../models/user';
export default (object: any, user: ILocalUser) => ({
type: 'Accept',
actor: `${config.url}/users/${user._id}`,
object
});

View File

@ -1,8 +1,14 @@
import config from '../../../config';
import { IUser, isLocalUser } from '../../../models/user';
export default (follower: IUser, followee: IUser) => ({
type: 'Follow',
actor: isLocalUser(follower) ? `${config.url}/users/${follower._id}` : follower.uri,
object: isLocalUser(followee) ? `${config.url}/users/${followee._id}` : followee.uri
});
export default (follower: IUser, followee: IUser, requestId?: string) => {
const follow = {
type: 'Follow',
actor: isLocalUser(follower) ? `${config.url}/users/${follower._id}` : follower.uri,
object: isLocalUser(followee) ? `${config.url}/users/${followee._id}` : followee.uri
} as any;
if (requestId) follow.id = requestId;
return follow;
};

View File

@ -1,4 +1,8 @@
export default (object: any) => ({
import config from '../../../config';
import { ILocalUser } from '../../../models/user';
export default (object: any, user: ILocalUser) => ({
type: 'Reject',
actor: `${config.url}/users/${user._id}`,
object
});

View File

@ -10,13 +10,13 @@ import renderAccept from '../../remote/activitypub/renderer/accept';
import { deliver } from '../../queue';
import createFollowRequest from './requests/create';
export default async function(follower: IUser, followee: IUser) {
export default async function(follower: IUser, followee: IUser, requestId?: string) {
// フォロー対象が鍵アカウントである or
// フォロワーがBotであり、フォロー対象がBotからのフォローに慎重である or
// フォロワーがローカルユーザーであり、フォロー対象がリモートユーザーである
// 上記のいずれかに当てはまる場合はすぐフォローせずにフォローリクエストを発行しておく
if (followee.isLocked || (followee.carefulBot && follower.isBot) || (isLocalUser(follower) && isRemoteUser(followee))) {
await createFollowRequest(follower, followee);
await createFollowRequest(follower, followee, requestId);
return;
}
@ -79,7 +79,7 @@ export default async function(follower: IUser, followee: IUser) {
}
if (isRemoteUser(follower) && isLocalUser(followee)) {
const content = pack(renderAccept(renderFollow(follower, followee)));
const content = pack(renderAccept(renderFollow(follower, followee, requestId), followee));
deliver(followee, content, follower.inbox);
}
}

View File

@ -29,7 +29,12 @@ export default async function(followee: IUser, follower: IUser) {
});
if (isRemoteUser(follower)) {
const content = pack(renderAccept(renderFollow(follower, followee)));
const request = await FollowRequest.findOne({
followeeId: followee._id,
followerId: follower._id
});
const content = pack(renderAccept(renderFollow(follower, followee, request.requestId), followee as ILocalUser));
deliver(followee as ILocalUser, content, follower.inbox);
}

View File

@ -6,11 +6,12 @@ import renderFollow from '../../../remote/activitypub/renderer/follow';
import { deliver } from '../../../queue';
import FollowRequest from '../../../models/follow-request';
export default async function(follower: IUser, followee: IUser) {
export default async function(follower: IUser, followee: IUser, requestId?: string) {
await FollowRequest.insert({
createdAt: new Date(),
followerId: follower._id,
followeeId: followee._id,
requestId,
// 非正規化
_follower: {

View File

@ -8,7 +8,12 @@ import { publishMainStream } from '../../../stream';
export default async function(followee: IUser, follower: IUser) {
if (isRemoteUser(follower)) {
const content = pack(renderReject(renderFollow(follower, followee)));
const request = await FollowRequest.findOne({
followeeId: followee._id,
followerId: follower._id
});
const content = pack(renderReject(renderFollow(follower, followee, request.requestId), followee as ILocalUser));
deliver(followee as ILocalUser, content, follower.inbox);
}