Skip to content

Commit

Permalink
10.102.1-l190425054738
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Apr 24, 2019
2 parents 398b6d9 + e78adb1 commit e1365f9
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "misskey",
"author": "syuilo <[email protected]>",
"version": "10.102.1-l190423011206",
"version": "10.102.1-l190425054738",
"codename": "nighthike",
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion src/client/app/admin/views/announcements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<ui-textarea v-model="announcement.text">
<span>{{ $t('text') }}</span>
</ui-textarea>
<ui-input v-model="announcement.image">
<span>{{ $t('image-url') }}</span>
</ui-input>
<ui-horizon-group class="fit-bottom">
<ui-button @click="save()"><fa :icon="['far', 'save']"/> {{ $t('save') }}</ui-button>
<ui-button @click="remove(i)"><fa :icon="['far', 'trash-alt']"/> {{ $t('remove') }}</ui-button>
Expand Down Expand Up @@ -43,7 +46,8 @@ export default Vue.extend({
add() {
this.announcements.unshift({
title: '',
text: ''
text: '',
image: null
});
},
Expand Down
3 changes: 2 additions & 1 deletion src/client/app/common/views/widgets/broadcast.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<p class="fetching" v-if="fetching">{{ $t('fetching') }}<mk-ellipsis/></p>
<h1 v-if="!fetching">{{ announcements.length == 0 ? $t('no-broadcasts') : announcements[i].title }}</h1>
<p v-if="!fetching">
<span v-if="announcements.length != 0" v-html="announcements[i].text"></span>
<mfm v-if="announcements.length != 0" :text="announcements[i].text" :key="i"/>
<img v-if="announcements.length != 0 && announcements[i].image" :src="announcements[i].image" alt="" style="display: block; max-height: 130px; max-width: 100%;"/>
<template v-if="announcements.length == 0">{{ $t('have-a-nice-day') }}</template>
</p>
<a v-if="announcements.length > 1" @click="next">{{ $t('next') }} &gt;&gt;</a>
Expand Down
3 changes: 2 additions & 1 deletion src/client/app/desktop/views/pages/welcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
<div v-if="announcements && announcements.length > 0">
<div v-for="announcement in announcements">
<h1 v-html="announcement.title"></h1>
<div v-html="announcement.text"></div>
<mfm :text="announcement.text"/>
<img v-if="announcement.image" :src="announcement.image" alt="" style="display: block; max-height: 130px; max-width: 100%;"/>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/client/app/mobile/views/components/ui.nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
<div class="announcements" v-if="announcements && announcements.length > 0">
<article v-for="announcement in announcements">
<span v-html="announcement.title" class="title"></span>
<div v-html="announcement.text"></div>
<div><mfm :text="announcement.text"/></div>
<img v-if="announcement.image" :src="announcement.image" alt="" style="display: block; max-height: 120px; max-width: 100%;"/>
</article>
</div>
<a :href="aboutUrl"><p class="about">{{ $t('about') }}</p></a>
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/mobile/views/pages/user/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
<div class="title">
<h1><mk-user-name :user="user" :key="user.id"/></h1>
<span class="username"><mk-acct :user="user" :detail="true" /></span>
<span class="username"><mk-acct :user="user" :detail="true" :key="user.id"/></span>
<span class="followed" v-if="user.isFollowed">{{ $t('follows-you') }}</span>
</div>
<div class="description">
Expand Down
3 changes: 2 additions & 1 deletion src/client/app/mobile/views/pages/welcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
<div class="announcements" v-if="announcements && announcements.length > 0">
<article v-for="announcement in announcements">
<span class="title" v-html="announcement.title"></span>
<div v-html="announcement.text"></div>
<mfm :text="announcement.text"/>
<img v-if="announcement.image" :src="announcement.image" alt="" style="display: block; max-height: 120px; max-width: 100%;"/>
</article>
</div>
<article class="about-misskey">
Expand Down
5 changes: 3 additions & 2 deletions src/misc/twemoji-base.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const twemojiBase = 'https://cdn.jsdelivr.net/npm/[email protected]';
// https://cdn.jsdelivr.net/npm/[email protected]
export const twemojiBase = 'https://cdn.jsdelivr.net/npm/[email protected]';
// https://cdn.jsdelivr.net/npm/[email protected]
// https://cdnjs.cloudflare.com/ajax/libs/twemoji/12.0.1
// https://twemoji.maxcdn.com
56 changes: 30 additions & 26 deletions src/remote/resolve-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,40 @@ export default async (username: string, _host: string, option?: any, resync = fa
},
});

logger.info(`try resync: ${acctLower}`);
const self = await resolveSelf(acctLower);

if (user.uri !== self.href) {
// if uri mismatch, Fix (user@host <=> AP's Person id(IRemoteUser.uri)) mapping.
logger.info(`uri missmatch: ${acctLower}`);
logger.info(`recovery missmatch uri for (username=${username}, host=${host}) from ${user.uri} to ${self.href}`);
try {
logger.info(`try resync: ${acctLower}`);
const self = await resolveSelf(acctLower);

if (user.uri !== self.href) {
// if uri mismatch, Fix (user@host <=> AP's Person id(IRemoteUser.uri)) mapping.
logger.info(`uri missmatch: ${acctLower}`);
logger.info(`recovery missmatch uri for (username=${username}, host=${host}) from ${user.uri} to ${self.href}`);

// validate uri
const uri = new URL(self.href);
if (uri.hostname !== hostAscii) {
throw new Error(`Invalied uri`);
}

// validate uri
const uri = new URL(self.href);
if (uri.hostname !== hostAscii) {
throw new Error(`Invalied uri`);
await User.update({
usernameLower,
host: host
}, {
$set: {
uri: self.href
}
});
} else {
logger.info(`uri is fine: ${acctLower}`);
}

await User.update({
usernameLower,
host: host
}, {
$set: {
uri: self.href
}
});
} else {
logger.info(`uri is fine: ${acctLower}`);
}

await updatePerson(self.href);
await updatePerson(self.href);

logger.info(`return resynced remote user: ${acctLower}`);
return await User.findOne({ uri: self.href });
logger.info(`return resynced remote user: ${acctLower}`);
return await User.findOne({ uri: self.href });
} catch (e) {
logger.warn(`resync failed: ${e.message || e}`);
}
}

logger.info(`return existing remote user: ${acctLower}`);
Expand Down

0 comments on commit e1365f9

Please sign in to comment.