Skip to content

Commit

Permalink
Merge pull request #61 from juzibot/feat/room-dynamic-qrcode
Browse files Browse the repository at this point in the history
feat: ✨ add parse room dynamic qrcode and join room by this qrcode
  • Loading branch information
su-chang authored Nov 15, 2024
2 parents 6a93960 + 2eb5156 commit 6ddb2d8
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.21
- name: Install Protoc
uses: arduino/setup-protoc@v1

Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.21

- name: Install Protoc
uses: arduino/setup-protoc@v1
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.21
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Install Protoc 3rd party protos
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@juzi/wechaty-grpc",
"version": "1.0.87",
"version": "1.0.89",
"description": "gRPC for Wechaty",
"type": "module",
"exports": {
Expand Down
11 changes: 11 additions & 0 deletions proto/wechaty/puppet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,12 @@ service Puppet {
get: "/rooms/{id}/qrcode"
};
}
rpc RoomParseDynamicQRCode (puppet.RoomParseDynamicQRCodeRequest) returns (puppet.RoomParseDynamicQRCodeResponse) {
option (google.api.http) = {
get: "/rooms/{url}/parse-dynamic-qrcode"
};
}

rpc RoomAnnounce (puppet.RoomAnnounceRequest) returns (puppet.RoomAnnounceResponse) {
option (google.api.http) = {
get: "/rooms/{id}/announcement" // TODO: disable other get parameters
Expand Down Expand Up @@ -598,6 +604,11 @@ service Puppet {
put: "/room-invitations/{id}/accept"
};
}
rpc RoomInvitationAcceptByQRCode (puppet.RoomInvitationAcceptByQRCodeRequest) returns (puppet.RoomInvitationAcceptByQRCodeResponse) {
option (google.api.http) = {
put: "/room-invitations/{qrcode}/accept-by-qrcode"
};
}

/**
*
Expand Down
8 changes: 8 additions & 0 deletions proto/wechaty/puppet/room-invitation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@ message RoomInvitationAcceptRequest {
string id = 1;
}
message RoomInvitationAcceptResponse {}

message RoomInvitationAcceptByQRCodeRequest {
string qrcode = 1;
}
message RoomInvitationAcceptByQRCodeResponse {
string room_id = 1;
string chat_id = 2;
}
9 changes: 9 additions & 0 deletions proto/wechaty/puppet/room.proto
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ message RoomQRCodeResponse {
string qrcode = 1;
}

message RoomParseDynamicQRCodeRequest {
string url = 1; // 群活码链接
}
message RoomParseDynamicQRCodeResponse {
string qrcode = 1; // 二维码url
string qrcode_image_url = 2; // 二维码图片url
string room_name = 3; // 群名称
}

message RoomAnnounceRequest { // 群公告
string id = 1;
google.protobuf.StringValue text_string_value_deprecated = 2 [deprecated = true]; // DEPRECATED, will be removed after Dec 31, 2022
Expand Down
12 changes: 12 additions & 0 deletions tests/puppet-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@ export const puppetServerImpl: IPuppetServer = {
throw new Error('not implemented.')
},

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

roomInvitationPayload: (call, callback) => {
void call
void callback
Expand Down Expand Up @@ -388,6 +394,12 @@ export const puppetServerImpl: IPuppetServer = {
throw new Error('not implemented.')
},

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

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

0 comments on commit 6ddb2d8

Please sign in to comment.