Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dirty rpc function definition for sync data #79

Merged
merged 16 commits into from
Aug 19, 2020
Merged
5 changes: 5 additions & 0 deletions proto/wechaty/puppet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ service Puppet {
*
*/
rpc ContactPayload (puppet.ContactPayloadRequest) returns (puppet.ContactPayloadResponse) {}
rpc ContactPayloadDirty (puppet.ContactPayloadDirtyRequest) returns (puppet.ContactPayloadDirtyResponse) {}

rpc ContactAlias (puppet.ContactAliasRequest) returns (puppet.ContactAliasResponse) {}
rpc ContactAvatar (puppet.ContactAvatarRequest) returns (puppet.ContactAvatarResponse) {}
Expand All @@ -72,6 +73,7 @@ service Puppet {
*
*/
rpc FriendshipPayload (puppet.FriendshipPayloadRequest) returns (puppet.FriendshipPayloadResponse) {}
rpc FriendshipPayloadDirty (puppet.FriendshipPayloadDirtyRequest) returns (puppet.FriendshipPayloadDirtyResponse) {}

rpc FriendshipSearchPhone (puppet.FriendshipSearchPhoneRequest) returns (puppet.FriendshipSearchPhoneResponse) {}
rpc FriendshipSearchWeixin (puppet.FriendshipSearchWeixinRequest) returns (puppet.FriendshipSearchWeixinResponse) {}
Expand All @@ -85,6 +87,7 @@ service Puppet {
*
*/
rpc MessagePayload (puppet.MessagePayloadRequest) returns (puppet.MessagePayloadResponse) {}
rpc MessagePayloadDirty (puppet.MessagePayloadDirtyRequest) returns (puppet.MessagePayloadDirtyResponse) {}

rpc MessageContact (puppet.MessageContactRequest) returns (puppet.MessageContactResponse) {}
rpc MessageFile (puppet.MessageFileRequest) returns (puppet.MessageFileResponse) {}
Expand All @@ -106,6 +109,7 @@ service Puppet {
*
*/
rpc RoomPayload (puppet.RoomPayloadRequest) returns (puppet.RoomPayloadResponse) {}
rpc RoomPayloadDirty (puppet.RoomPayloadDirtyRequest) returns (puppet.RoomPayloadDirtyResponse) {}

rpc RoomList (puppet.RoomListRequest) returns (puppet.RoomListResponse) {}

Expand All @@ -125,6 +129,7 @@ service Puppet {
*
*/
rpc RoomMemberPayload (puppet.RoomMemberPayloadRequest) returns (puppet.RoomMemberPayloadResponse) {}
rpc RoomMemberPayloadDirty (puppet.RoomMemberPayloadDirtyRequest) returns (puppet.RoomMemberPayloadDirtyResponse) {}

rpc RoomMemberList (puppet.RoomMemberListRequest) returns (puppet.RoomMemberListResponse) {}

Expand Down
5 changes: 5 additions & 0 deletions proto/wechaty/puppet/contact.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ message ContactPayloadResponse {
string weixin = 13;
}

message ContactPayloadDirtyRequest {
string id = 1;
}
message ContactPayloadDirtyResponse {}

message ContactSelfQRCodeRequest {}
message ContactSelfQRCodeResponse {
string qrcode = 1;
Expand Down
6 changes: 6 additions & 0 deletions proto/wechaty/puppet/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ enum EventType {
EVENT_TYPE_RESET = 24;
EVENT_TYPE_LOGIN = 25;
EVENT_TYPE_LOGOUT = 26;

EVENT_TYPE_CONTACT_DIRTY = 27;
huan marked this conversation as resolved.
Show resolved Hide resolved
EVENT_TYPE_ROOM_DIRTY = 28;
EVENT_TYPE_FRIENDSHIP_DIRTY = 29;
EVENT_TYPE_MESSAGE_DIRTY = 30;
EVENT_TYPE_ROOM_MEMBER_DIRTY = 31;
huan marked this conversation as resolved.
Show resolved Hide resolved
}

message EventRequest {}
Expand Down
5 changes: 5 additions & 0 deletions proto/wechaty/puppet/friendship.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ message FriendshipPayloadResponse {
FriendshipSceneType scene = 7;
}

message FriendshipPayloadDirtyRequest {
string id = 1;
}
message FriendshipPayloadDirtyResponse {}

message FriendshipSearchPhoneRequest {
string phone = 1;
}
Expand Down
5 changes: 5 additions & 0 deletions proto/wechaty/puppet/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ message MessagePayloadResponse {
repeated string mention_ids = 9;
}

message MessagePayloadDirtyRequest {
string id = 1;
}
message MessagePayloadDirtyResponse {}

message MessageImageRequest {
string id = 1;
ImageType type = 2;
Expand Down
5 changes: 5 additions & 0 deletions proto/wechaty/puppet/room.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ message RoomPayloadResponse {
repeated string member_ids = 6;
}

message RoomPayloadDirtyRequest {
string id = 1;
}
message RoomPayloadDirtyResponse {}

message RoomAddRequest {
string id = 1;
string contact_id = 2;
Expand Down
5 changes: 5 additions & 0 deletions proto/wechaty/puppet/room_member.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ message RoomMemberPayloadResponse {
string name = 5;
}

message RoomMemberPayloadDirtyRequest {
string id = 1;
}
message RoomMemberPayloadDirtyResponse {}

message RoomMemberListRequest {
string id = 1;
}
Expand Down
30 changes: 30 additions & 0 deletions tests/puppet-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export const puppetServerImpl: IPuppetServer = {
throw new Error('not implmented.')
},

contactPayloadDirty: (call, callback) => {
windmemory marked this conversation as resolved.
Show resolved Hide resolved
void call
void callback
throw new Error('not implmented.')
},

contactSelfName: (call, callback) => {
void call
void callback
Expand Down Expand Up @@ -79,6 +85,12 @@ export const puppetServerImpl: IPuppetServer = {
throw new Error('not implmented.')
},

friendshipPayloadDirty: (call, callback) => {
void call
void callback
throw new Error('not implmented.')
},

friendshipSearchPhone: (call, callback) => {
void call
void callback
Expand Down Expand Up @@ -127,6 +139,12 @@ export const puppetServerImpl: IPuppetServer = {
throw new Error('not implmented.')
},

messagePayloadDirty: (call, callback) => {
void call
void callback
throw new Error('not implmented.')
},

messageRecall: (call, callback) => {
void call
void callback
Expand Down Expand Up @@ -229,12 +247,24 @@ export const puppetServerImpl: IPuppetServer = {
throw new Error('not implmented.')
},

roomMemberPayloadDirty: (call, callback) => {
void call
void callback
throw new Error('not implmented.')
},

roomPayload: (call, callback) => {
void call
void callback
throw new Error('not implmented.')
},

roomPayloadDirty: (call, callback) => {
void call
void callback
throw new Error('not implmented.')
},

roomQRCode: (call, callback) => {
void call
void callback
Expand Down