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

Silent Mode backend profile setting/migration #1038

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions api/proto/user_service/user_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ service AuthenticationService {
returns (NotifyAccountClosureResponse);
// These two temporary endpoints for migrating everyone to naked domain:
rpc GetSignedCookie(GetSignedCookieRequest) returns (SignedCookieResponse);
rpc InstallSignedCookie(SignedCookieResponse) returns (InstallSignedCookieResponse);
rpc InstallSignedCookie(SignedCookieResponse)
returns (InstallSignedCookieResponse);
}

message GetSignedCookieRequest {}
Expand Down Expand Up @@ -135,12 +136,18 @@ message ProfileResponse {
string user_id = 8;
string avatar_url = 9;
string full_name = 10;
bool avatars_editable = 11;
bool avatars_editable = 11 [ deprecated = true ];
string birth_date = 12;
bool silent_mode = 13;
}

message PersonalInfoRequest {}

// PersonalInfoResponse is sent when we query our own
// profile (in order to modify it) on the front end. It contains
// a field that is not part of the profile model/table itself -- email
// We should consider combining this with the ProfileResponse message,
// and just leaving the email field blank when making a profile request.
message PersonalInfoResponse {
string email = 1;
string first_name = 2;
Expand All @@ -150,6 +157,7 @@ message PersonalInfoResponse {
string full_name = 6;
string about = 7;
string birth_date = 8;
bool silent_mode = 9;
}

message UpdatePersonalInfoRequest {
Expand All @@ -161,6 +169,7 @@ message UpdatePersonalInfoRequest {
string full_name = 6;
string about = 7;
string birth_date = 8;
bool silent_mode = 9;
}

message UpdatePersonalInfoResponse {}
Expand All @@ -181,6 +190,7 @@ message BriefProfile {
string full_name = 2; // omitted for non-adults
string country_code = 3;
string avatar_url = 9;
bool silent_mode = 13;
}

message BriefProfilesResponse { map<string, BriefProfile> response = 1; }
Expand Down
5 changes: 5 additions & 0 deletions db/migrations/202207020046_add-silent-mode.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;

ALTER TABLE public.profiles DROP COLUMN IF EXISTS "silent_mode";

COMMIT;
5 changes: 5 additions & 0 deletions db/migrations/202207020046_add-silent-mode.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;

ALTER TABLE public.profiles ADD COLUMN IF NOT EXISTS "silent_mode" BOOLEAN;

COMMIT;
6 changes: 3 additions & 3 deletions liwords-ui/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,17 @@ a.plain,
}
}
}
.ant-modal-body .readable-text-color {
.readable-text-color {
@include colorModed() {
color: m($gray-extreme);
}
}
.tourney-editor .readable-text-color {
.readable-text-color {
@include colorModed() {
color: m($gray-extreme);
}
}
.ant-list-items .readable-text-color {
.readable-text-color {
@include colorModed() {
color: m($gray-extreme);
}
Expand Down
6 changes: 6 additions & 0 deletions liwords-ui/src/chat/playerList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
.country-flag {
margin-left: 9px;
}
.ant-dropdown-trigger {
i {
margin-left: 0.5em;
opacity: 0.5;
}
}
&.offline {
.player-name {
@include colorModed() {
Expand Down
1 change: 1 addition & 0 deletions liwords-ui/src/chat/players.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const Player = React.memo((props: PlayerProps) => {
userID={props.uuid}
moderate={moderateUser}
includeFlag
showSilentMode
omitBlock={props.className === 'friends'}
showModTools
sendMessage={props.sendMessage}
Expand Down
16 changes: 16 additions & 0 deletions liwords-ui/src/gen/api/proto/user_service/user_service_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,9 @@ export class ProfileResponse extends jspb.Message {
getBirthDate(): string;
setBirthDate(value: string): void;

getSilentMode(): boolean;
setSilentMode(value: boolean): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ProfileResponse.AsObject;
static toObject(includeInstance: boolean, msg: ProfileResponse): ProfileResponse.AsObject;
Expand All @@ -637,6 +640,7 @@ export namespace ProfileResponse {
fullName: string,
avatarsEditable: boolean,
birthDate: string,
silentMode: boolean,
}
}

Expand Down Expand Up @@ -681,6 +685,9 @@ export class PersonalInfoResponse extends jspb.Message {
getBirthDate(): string;
setBirthDate(value: string): void;

getSilentMode(): boolean;
setSilentMode(value: boolean): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): PersonalInfoResponse.AsObject;
static toObject(includeInstance: boolean, msg: PersonalInfoResponse): PersonalInfoResponse.AsObject;
Expand All @@ -701,6 +708,7 @@ export namespace PersonalInfoResponse {
fullName: string,
about: string,
birthDate: string,
silentMode: boolean,
}
}

Expand Down Expand Up @@ -729,6 +737,9 @@ export class UpdatePersonalInfoRequest extends jspb.Message {
getBirthDate(): string;
setBirthDate(value: string): void;

getSilentMode(): boolean;
setSilentMode(value: boolean): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UpdatePersonalInfoRequest.AsObject;
static toObject(includeInstance: boolean, msg: UpdatePersonalInfoRequest): UpdatePersonalInfoRequest.AsObject;
Expand All @@ -749,6 +760,7 @@ export namespace UpdatePersonalInfoRequest {
fullName: string,
about: string,
birthDate: string,
silentMode: boolean,
}
}

Expand Down Expand Up @@ -877,6 +889,9 @@ export class BriefProfile extends jspb.Message {
getAvatarUrl(): string;
setAvatarUrl(value: string): void;

getSilentMode(): boolean;
setSilentMode(value: boolean): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BriefProfile.AsObject;
static toObject(includeInstance: boolean, msg: BriefProfile): BriefProfile.AsObject;
Expand All @@ -893,6 +908,7 @@ export namespace BriefProfile {
fullName: string,
countryCode: string,
avatarUrl: string,
silentMode: boolean,
}
}

Expand Down
Loading