summaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-04-01 19:57:36 +0900
committerGitHub <noreply@github.com>2018-04-01 19:57:36 +0900
commitfabda94932ebdd012b0772ce1e63ac515f546d84 (patch)
tree1c5ffb9d42ebdb9f1830b331d3c1611b8ebc13ae /src/models
parentfix(package): update html-minifier to version 3.5.13 (diff)
parentMerge pull request #1354 from syuilo/greenkeeper/bootstrap-vue-2.0.0-rc.4 (diff)
downloadmisskey-fabda94932ebdd012b0772ce1e63ac515f546d84.tar.gz
misskey-fabda94932ebdd012b0772ce1e63ac515f546d84.tar.bz2
misskey-fabda94932ebdd012b0772ce1e63ac515f546d84.zip
Merge branch 'master' into greenkeeper/html-minifier-3.5.13
Diffstat (limited to 'src/models')
-rw-r--r--src/models/post.ts1
-rw-r--r--src/models/user.ts59
2 files changed, 5 insertions, 55 deletions
diff --git a/src/models/post.ts b/src/models/post.ts
index 6c853e4f81..4daad306d6 100644
--- a/src/models/post.ts
+++ b/src/models/post.ts
@@ -30,6 +30,7 @@ export type IPost = {
repostId: mongo.ObjectID;
poll: any; // todo
text: string;
+ tags: string[];
textHtml: string;
cw: string;
userId: mongo.ObjectID;
diff --git a/src/models/user.ts b/src/models/user.ts
index 4728682d67..9588c45153 100644
--- a/src/models/user.ts
+++ b/src/models/user.ts
@@ -71,6 +71,10 @@ export type ILocalAccount = {
export type IRemoteAccount = {
uri: string;
+ publicKey: {
+ id: string;
+ publicKeyPem: string;
+ };
};
export type IUser = {
@@ -278,61 +282,6 @@ export const pack = (
resolve(_user);
});
-/**
- * Pack a user for ActivityPub
- *
- * @param user target
- * @return Packed user
- */
-export const packForAp = (
- user: string | mongo.ObjectID | IUser
-) => new Promise<any>(async (resolve, reject) => {
-
- let _user: any;
-
- const fields = {
- // something
- };
-
- // Populate the user if 'user' is ID
- if (mongo.ObjectID.prototype.isPrototypeOf(user)) {
- _user = await User.findOne({
- _id: user
- }, { fields });
- } else if (typeof user === 'string') {
- _user = await User.findOne({
- _id: new mongo.ObjectID(user)
- }, { fields });
- } else {
- _user = deepcopy(user);
- }
-
- if (!_user) return reject('invalid user arg.');
-
- const userUrl = `${config.url}/@@${_user._id}`;
-
- resolve({
- "@context": ["https://www.w3.org/ns/activitystreams", {
- "@language": "ja"
- }],
- "type": "Person",
- "id": userUrl,
- "following": `${userUrl}/following.json`,
- "followers": `${userUrl}/followers.json`,
- "liked": `${userUrl}/liked.json`,
- "inbox": `${userUrl}/inbox.json`,
- "outbox": `${userUrl}/outbox.json`,
- "sharedInbox": `${config.url}/inbox`,
- "url": `${config.url}/@${_user.username}`,
- "preferredUsername": _user.username,
- "name": _user.name,
- "summary": _user.description,
- "icon": [
- `${config.drive_url}/${_user.avatarId}`
- ]
- });
-});
-
/*
function img(url) {
return {