Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
38e2853dcf | ||
![]() |
ba5a540ca3 | ||
![]() |
fb1e05c2e9 | ||
![]() |
aba84612a7 | ||
![]() |
9bebbf4e03 | ||
![]() |
e41b3f9c10 | ||
![]() |
890dc05022 | ||
![]() |
375f86ec82 |
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "10.4.0",
|
||||
"clientVersion": "1.0.10397",
|
||||
"version": "10.5.0",
|
||||
"clientVersion": "1.0.10405",
|
||||
"codename": "nighthike",
|
||||
"main": "./built/index.js",
|
||||
"private": true,
|
||||
|
@@ -170,7 +170,7 @@ abstract class Connection extends EventEmitter {
|
||||
const type = payload === undefined ? typeOrPayload.type : typeOrPayload;
|
||||
const body = payload === undefined ? typeOrPayload.body : payload;
|
||||
|
||||
this.stream.send('channel', {
|
||||
this.stream.send('ch', {
|
||||
id: this.id,
|
||||
type: type,
|
||||
body: body
|
||||
|
@@ -111,6 +111,7 @@ async function workerMain() {
|
||||
*/
|
||||
async function init(): Promise<Config> {
|
||||
Logger.info('Welcome to Misskey!');
|
||||
Logger.info(`<<< Misskey v${pkg.version} >>>`);
|
||||
|
||||
new Logger('Deps').info(`Node.js ${process.version}`);
|
||||
MachineInfo.show();
|
||||
|
@@ -3,8 +3,8 @@ import $ from 'cafy';
|
||||
import User, { pack, ILocalUser } from '../../../../models/user';
|
||||
import { getFriendIds } from '../../common/get-friends';
|
||||
import Mute from '../../../../models/mute';
|
||||
import * as request from 'request'
|
||||
import config from '../../../../config'
|
||||
import * as request from 'request';
|
||||
import config from '../../../../config';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
@@ -18,18 +18,19 @@ export const meta = {
|
||||
|
||||
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
|
||||
if (config.user_recommendation && config.user_recommendation.external) {
|
||||
const userName = me.username
|
||||
const hostName = config.hostname
|
||||
const limit = params.limit
|
||||
const offset = params.offset
|
||||
const timeout = config.user_recommendation.timeout
|
||||
const engine = config.user_recommendation.engine
|
||||
const userName = me.username;
|
||||
const hostName = config.hostname;
|
||||
const limit = params.limit;
|
||||
const offset = params.offset;
|
||||
const timeout = config.user_recommendation.timeout;
|
||||
const engine = config.user_recommendation.engine;
|
||||
const url = engine
|
||||
.replace('{{host}}', hostName)
|
||||
.replace('{{user}}', userName)
|
||||
.replace('{{limit}}', limit)
|
||||
.replace('{{offset}}', offset)
|
||||
request(
|
||||
.replace('{{offset}}', offset);
|
||||
|
||||
request(
|
||||
{
|
||||
url: url,
|
||||
timeout: timeout,
|
||||
@@ -39,12 +40,12 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
|
||||
},
|
||||
(error: any, response: any, body: any) => {
|
||||
if (!error && response.statusCode == 200) {
|
||||
res(body)
|
||||
res(body);
|
||||
} else {
|
||||
res([])
|
||||
res([]);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
} else {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
@@ -67,7 +68,7 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
|
||||
_id: {
|
||||
$nin: followingIds.concat(mutedUserIds)
|
||||
},
|
||||
isLocked: false,
|
||||
isLocked: { $ne: true },
|
||||
$or: [{
|
||||
lastUsedAt: {
|
||||
$gte: new Date(Date.now() - ms('7days'))
|
||||
|
@@ -58,6 +58,7 @@ export default class Connection {
|
||||
case 'connect': this.onChannelConnectRequested(body); break;
|
||||
case 'disconnect': this.onChannelDisconnectRequested(body); break;
|
||||
case 'channel': this.onChannelMessageRequested(body); break;
|
||||
case 'ch': this.onChannelMessageRequested(body); break; // alias
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +181,9 @@ export default class Connection {
|
||||
const channel = new channelClass(id, this);
|
||||
this.channels.push(channel);
|
||||
channel.init(params);
|
||||
this.sendMessageToWs('connected', {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user