Skip to content
Open
6 changes: 3 additions & 3 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1117,9 +1117,9 @@
"allChannelsPageTitle": {"type": "String", "example": "All channels"}
}
},
"sharePageTitle": "Share",
"@sharePageTitle": {
"description": "Title for the page about sharing content received from other apps."
"shareChooseAccountLabel": "Choose an account",
"@shareChooseAccountLabel": {
"description": "Label for the page about selecting an account to share content received from other apps."
},
"mainMenuMyProfile": "My profile",
"@mainMenuMyProfile": {
Expand Down
6 changes: 6 additions & 0 deletions lib/api/model/initial_snapshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class InitialSnapshot {

final bool realmMandatoryTopics;

final String realmName;

/// The number of days until a user's account is treated as a full member.
///
/// Search for "realm_waiting_period_threshold" in https://zulip.com/api/register-queue.
Expand All @@ -105,6 +107,8 @@ class InitialSnapshot {

final bool realmEnableReadReceipts;

final Uri realmIconUrl;

final bool realmPresenceDisabled;

final Map<String, RealmDefaultExternalAccount> realmDefaultExternalAccounts;
Expand Down Expand Up @@ -176,11 +180,13 @@ class InitialSnapshot {
required this.realmDeleteOwnMessagePolicy,
required this.realmWildcardMentionPolicy,
required this.realmMandatoryTopics,
required this.realmName,
required this.realmWaitingPeriodThreshold,
required this.realmMessageContentDeleteLimitSeconds,
required this.realmAllowMessageEditing,
required this.realmMessageContentEditLimitSeconds,
required this.realmEnableReadReceipts,
required this.realmIconUrl,
required this.realmPresenceDisabled,
required this.realmDefaultExternalAccounts,
required this.maxFileUploadSizeMib,
Expand Down
4 changes: 4 additions & 0 deletions lib/api/model/initial_snapshot.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/api/route/realm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class GetServerSettingsResult {
final Uri realmUrl;

final String realmName;
final String realmIcon;
final Uri realmIcon;
final String realmDescription;
final bool realmWebPublicAccessEnabled;

Expand Down
4 changes: 2 additions & 2 deletions lib/api/route/realm.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1647,11 +1647,11 @@ abstract class ZulipLocalizations {
String allChannelsPageTitle,
);

/// Title for the page about sharing content received from other apps.
/// Label for the page about selecting an account to share content received from other apps.
///
/// In en, this message translates to:
/// **'Share'**
String get sharePageTitle;
/// **'Choose an account'**
String get shareChooseAccountLabel;

/// Label for main-menu button leading to the user's own profile.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Share';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'My profile';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Teilen';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'Mein Profil';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Share';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'My profile';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Share';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'My profile';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ class ZulipLocalizationsIt extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Share';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'Il mio profilo';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
}

@override
String get sharePageTitle => '共有';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => '自分のプロフィール';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_nb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Share';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'My profile';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Udostępnij';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'Mój profil';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Поделиться';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'Мой профиль';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_sk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Share';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'Môj profil';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_sl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ class ZulipLocalizationsSl extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Deli';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'Moj profil';
Expand Down
2 changes: 1 addition & 1 deletion lib/generated/l10n/zulip_localizations_uk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ class ZulipLocalizationsUk extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Поділитися';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'Мій профіль';
Expand Down
8 changes: 1 addition & 7 deletions lib/generated/l10n/zulip_localizations_zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ class ZulipLocalizationsZh extends ZulipLocalizations {
}

@override
String get sharePageTitle => 'Share';
String get shareChooseAccountLabel => 'Choose an account';

@override
String get mainMenuMyProfile => 'My profile';
Expand Down Expand Up @@ -2014,9 +2014,6 @@ class ZulipLocalizationsZhHansCn extends ZulipLocalizationsZh {
@override
String get channelsEmptyPlaceholder => '您还没有订阅任何频道。';

@override
String get sharePageTitle => '分享';

@override
String get mainMenuMyProfile => '个人资料';

Expand Down Expand Up @@ -3127,9 +3124,6 @@ class ZulipLocalizationsZhHantTw extends ZulipLocalizationsZh {
return '您尚未訂閱任何頻道。請前往 <z-link>$allChannelsPageTitle</z-link> 並加入一些頻道。';
}

@override
String get sharePageTitle => '分享';

@override
String get mainMenuMyProfile => '我的設定檔';

Expand Down
21 changes: 20 additions & 1 deletion lib/model/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:drift/internal/versioned_schema.dart';
import 'package:drift/remote.dart';
import 'package:sqlite3/common.dart';

import '../api/route/realm.dart';
import '../log.dart';
import 'legacy_app_data.dart';
import 'schema_versions.g.dart';
Expand Down Expand Up @@ -123,6 +124,20 @@ class Accounts extends Table {
/// It never changes for a given account.
Column<String> get realmUrl => text().map(const UriConverter())();

/// The name of the Zulip realm this account is on.
///
/// This corresponds to [GetServerSettingsResult.realmName].
///
/// Nullable just because older versions of the app didn't store this.
Column<String> get realmName => text().nullable()();

/// The icon URL of the Zulip realm this account is on.
///
/// This corresponds to [GetServerSettingsResult.realmIcon].
///
/// Nullable just because older versions of the app didn't store this.
Column<String> get realmIcon => text().map(const UriConverter()).nullable()();

/// The Zulip user ID of this account.
///
/// This is the identifier the server uses for the account.
Expand Down Expand Up @@ -164,7 +179,7 @@ class AppDatabase extends _$AppDatabase {
// information on using the build_runner.
// * Write a migration in `_migrationSteps` below.
// * Write tests.
static const int latestSchemaVersion = 11; // See note.
static const int latestSchemaVersion = 12; // See note.

@override
int get schemaVersion => latestSchemaVersion;
Expand Down Expand Up @@ -259,6 +274,10 @@ class AppDatabase extends _$AppDatabase {
'value': Variable(firstAccountId),
}));
},
from11To12: (Migrator m, Schema12 schema) async {
await m.addColumn(schema.accounts, schema.accounts.realmName);
await m.addColumn(schema.accounts, schema.accounts.realmIcon);
},
);

Future<void> _createLatestSchema(Migrator m) async {
Expand Down
Loading