mirror of
https://github.com/BlueBubblesApp/bluebubbles-app.git
synced 2025-07-01 21:06:29 +08:00
Limit scheduled messages & unsend to newer server versions
This commit is contained in:
@ -275,7 +275,7 @@ class _MessagePopupState extends OptimizedState<MessagePopup> with SingleTickerP
|
|||||||
style: context.textTheme.bodyLarge!.apply(color: context.theme.colorScheme.properOnSurface),
|
style: context.textTheme.bodyLarge!.apply(color: context.theme.colorScheme.properOnSurface),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (ss.isMinVenturaSync && message.isFromMe!)
|
if (ss.isMinVenturaSync && message.isFromMe! && ss.serverDetailsSync().item4 >= 148)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
value: 6,
|
value: 6,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -1118,7 +1118,7 @@ class _MessagePopupState extends OptimizedState<MessagePopup> with SingleTickerP
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (ss.isMinVenturaSync && message.isFromMe!)
|
if (ss.isMinVenturaSync && message.isFromMe! && ss.serverDetailsSync().item4 >= 148)
|
||||||
Material(
|
Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
@ -181,31 +181,33 @@ class _SettingsPageState extends OptimizedState<SettingsPage> {
|
|||||||
trailing: nextIcon,
|
trailing: nextIcon,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
Container(
|
if (ss.serverDetailsSync().item4 >= 205)
|
||||||
color: tileColor,
|
Container(
|
||||||
child: Padding(
|
color: tileColor,
|
||||||
padding: const EdgeInsets.only(left: 65.0),
|
child: Padding(
|
||||||
child: SettingsDivider(color: context.theme.colorScheme.surfaceVariant),
|
padding: const EdgeInsets.only(left: 65.0),
|
||||||
|
child: SettingsDivider(color: context.theme.colorScheme.surfaceVariant),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
if (ss.serverDetailsSync().item4 >= 205)
|
||||||
SettingsTile(
|
SettingsTile(
|
||||||
backgroundColor: tileColor,
|
backgroundColor: tileColor,
|
||||||
title: "Scheduled Messages",
|
title: "Scheduled Messages",
|
||||||
subtitle: "Schedule your server to send a message in the future or at set intervals",
|
subtitle: "Schedule your server to send a message in the future or at set intervals",
|
||||||
isThreeLine: true,
|
isThreeLine: true,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
ns.pushAndRemoveSettingsUntil(
|
ns.pushAndRemoveSettingsUntil(
|
||||||
context,
|
context,
|
||||||
ScheduledMessagesPanel(),
|
ScheduledMessagesPanel(),
|
||||||
(route) => route.isFirst,
|
(route) => route.isFirst,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
trailing: nextIcon,
|
trailing: nextIcon,
|
||||||
leading: const SettingsLeadingIcon(
|
leading: const SettingsLeadingIcon(
|
||||||
iosIcon: CupertinoIcons.calendar_today,
|
iosIcon: CupertinoIcons.calendar_today,
|
||||||
materialIcon: Icons.schedule_send_outlined,
|
materialIcon: Icons.schedule_send_outlined,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SettingsHeader(
|
SettingsHeader(
|
||||||
|
@ -103,6 +103,9 @@ class SettingsService extends GetxService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Tuple4<int, int, String, int> serverDetailsSync() =>
|
||||||
|
Tuple4(prefs.getInt("macos-version") ?? 11, prefs.getInt("macos-minor-version") ?? 0, prefs.getString("server-version") ?? "0.0.0", prefs.getInt("server-version-code") ?? 0);
|
||||||
|
|
||||||
Future<bool> get isMinSierra async {
|
Future<bool> get isMinSierra async {
|
||||||
final val = await getServerDetails();
|
final val = await getServerDetails();
|
||||||
return val.item1 > 10 || (val.item1 == 10 && val.item2 > 11);
|
return val.item1 > 10 || (val.item1 == 10 && val.item2 > 11);
|
||||||
|
Reference in New Issue
Block a user