Skip to content

Commit

Permalink
Update 3.6
Browse files Browse the repository at this point in the history
- Fix unexpected crash while copying from profile
- New option to bring Tweet source back
  • Loading branch information
BandarHL committed Jan 7, 2023
1 parent 3282cc3 commit a2f0741
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 46 deletions.
1 change: 1 addition & 0 deletions BHTwitter/BHTManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@
+ (BOOL)hideWhoToFollow;
+ (BOOL)hideTopicsToFollow;
+ (BOOL)hideViewCount;
+ (BOOL)showTweetSource;
@end

3 changes: 3 additions & 0 deletions BHTwitter/BHTManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ + (BOOL)hideTopicsToFollow {
+ (BOOL)hideViewCount {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_view_count"];
}
+ (BOOL)showTweetSource {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"show_tweet_source"];
}

+ (UIViewController *)BHTSettingsWithAccount:(TFNTwitterAccount *)twAccount {
SettingsViewController *pref = [[SettingsViewController alloc] initWithTwitterAccount:twAccount];
Expand Down
37 changes: 27 additions & 10 deletions BHTwitter/BHTwitter.xm
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,30 @@
[copyButton setImage:[UIImage systemImageNamed:@"doc.on.clipboard"] forState:UIControlStateNormal];
if (@available(iOS 14.0, *)) {
[copyButton setShowsMenuAsPrimaryAction:true];

[copyButton setMenu:[UIMenu menuWithTitle:@"" children:@[
[UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_1"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.bio;
if (self.viewModel.bio != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.bio;
}],
[UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_2"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.username;
if (self.viewModel.username != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.username;
}],
[UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_3"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.fullName;
if (self.viewModel.fullName != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.fullName;
}],
[UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_4"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.url;
if (self.viewModel.url != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.url;
}],
[UIAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_5"] image:[UIImage systemImageNamed:@"doc.on.clipboard"] identifier:nil handler:^(__kindof UIAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.location;
if (self.viewModel.location != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.location;
}],
]]];

} else {
[copyButton addTarget:self action:@selector(copyButtonHandler:) forControlEvents:UIControlEventTouchUpInside];
}
Expand Down Expand Up @@ -144,19 +151,24 @@
alert.popoverPresentationController.sourceRect = sender.frame;
}
UIAlertAction *bio = [UIAlertAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_1"] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.bio;
if (self.viewModel.bio != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.bio;
}];
UIAlertAction *username = [UIAlertAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_2"] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.username;
if (self.viewModel.username != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.username;
}];
UIAlertAction *fullusername = [UIAlertAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_3"] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.fullName;
if (self.viewModel.fullName != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.fullName;
}];
UIAlertAction *url = [UIAlertAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_4"] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.url;
if (self.viewModel.url != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.url;
}];
UIAlertAction *location = [UIAlertAction actionWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"COPY_PROFILE_INFO_MENU_OPTION_5"] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
UIPasteboard.generalPasteboard.string = self.viewModel.location;
if (self.viewModel.location != nil)
UIPasteboard.generalPasteboard.string = self.viewModel.location;
}];
[alert addAction:bio];
[alert addAction:username];
Expand Down Expand Up @@ -638,6 +650,11 @@
if ([key isEqualToString:@"conversational_replies_ios_pinned_replies_consumption_enabled"] || [key isEqualToString:@"conversational_replies_ios_pinned_replies_creation_enabled"]) {
return true;
}

if ([BHTManager showTweetSource] && [key isEqualToString:@"show_tweet_source_disabled"]) {
return false;
}

return %orig;
}
%end
Expand Down
2 changes: 1 addition & 1 deletion BHTwitter/Package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.bandarhl.BHTwitter
Name: BHTwitter
Version: 3.5
Version: 3.6
Description: Awesome tweak for Twitter
Section: Tweaks
Depends: firmware (>= 13.0), mobilesubstrate, ws.hbang.common (>= 1.17)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
"HIDE_VIEW_COUNT_OPTION_TITLE" = "إخفاء عدد مُشاهدة التغريدة";
"HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE" = "إزالة عدد المُشاهدات من التغريدة";

"SHOW_TWEET_SOURCE_TITLE" = "إظهار مصدر التغريدة ";

"FONT_OPTION_TITLE" = "تفعيل تغيير خط التطبيق";
"FONT_OPTION_DETAIL_TITLE" = "خيار لتفعيل تغيير خط تويتر";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
"HIDE_VIEW_COUNT_OPTION_TITLE" = "Hide view count";
"HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE" = "Remove view count from tweet";

"SHOW_TWEET_SOURCE_TITLE" = "Show tweet source";

"FONT_OPTION_TITLE" = "Enable changing font";
"FONT_OPTION_DETAIL_TITLE" = "Option to allow changing Twitter font and show font picker.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
"BIO_TRANSALTE_OPTION_DETAIL_TITLE" = "プロフィールを翻訳するボタンを追加します。";

"LIKE_CONFIRM_OPTION_TITLE" = "いいねの確認";
"LIKE_CONFIRM_OPTION_DETAIL_TITLE" = "いいねボタンを押した時、確認の通知が表示されます。";
"LIKE_CONFIRM_OPTION_DETAIL_TITLE" = "いいねボタンを押した時、\n確認の通知が表示されます。";

"TWEET_CONFIRM_OPTION_TITLE" = "ツイートの確認";
"TWEET_CONFIRM_OPTION_DETAIL_TITLE" = "ツイートボタンを押した時、確認の通知が表示されます。";
"TWEET_CONFIRM_OPTION_DETAIL_TITLE" = "ツイートボタンを押した時、\n確認の通知が表示されます。";

"FOLLOW_CONFIRM_OPTION_TITLE" = "フォローの確認";
"FOLLOW_CONFIRM_OPTION_DETAIL_TITLE" = "フォローボタンを押した時、確認の通知が表示されます。";
"FOLLOW_CONFIRM_OPTION_DETAIL_TITLE" = "フォローボタンを押した時、\n確認の通知が表示されます。";

"PADLOCK_OPTION_TITLE" = "起動時パスワード";
"PADLOCK_OPTION_DETAIL_TITLE" = "Twitterをパスワードでロックします。";
Expand All @@ -79,7 +79,7 @@
"DN_MODULAR_SEARCH_OPTION_DETAIL_TITLE" = "DM検索の新しいUIを有効にします。";

"AUTO_HIGHEST_LOAD_OPTION_TITLE" = "自動で画像を最高画質で読み込む";
"AUTO_HIGHEST_LOAD_OPTION_DETAIL_TITLE" = "投稿または読み込みの時、可能な限り良い画質にします。";
"AUTO_HIGHEST_LOAD_OPTION_DETAIL_TITLE" = "投稿または読み込みの際、\n可能な限り良い画質にします。";

"DISABLE_SENSITIVE_TWEET_WARNINGS_OPTION_TITLE" = "センシティブな画像の警告を無効化";
"TRUSTED_FRIENSS_OPTION_TITLE" = "Twitterサークルを有効化";
Expand All @@ -93,17 +93,17 @@
"HIDE_SPACE_OPTION_TITLE" = "スペースバーを消す";

"DISABLE_RTL_OPTION_TITLE" = "RTLの無効化";
"DISABLE_RTL_OPTION_DETAIL_TITLE" = "右向きの言語を左向きで表示します。\n設定を適応させるにはアプリの再起動をしてください。";
"DISABLE_RTL_OPTION_DETAIL_TITLE" = "右向きの言語を左向きで表示します。\n設定を適応させるにはTwitterを再起動してください。";

"ALWAYS_OPEN_SAFARI_OPTION_TITLE" = "常にSafariで開く";
"ALWAYS_OPEN_SAFARI_OPTION_DETAIL_TITLE" = "URLをSafari、もしくはデフォルトのブラウザで開きます。";

"TWITTER_BLUE_SECTION_HEADER_TITLE" = "Twitter blueの機能";
"UNDO_TWEET_OPTION_TITLE" = "ツイートの取り消し";
"UNDO_TWEET_OPTION_DETAIL_TITLE" = "ツイートをした後、そのツイートを取り消せます。";
"UNDO_TWEET_OPTION_DETAIL_TITLE" = "ツイートした後、そのツイートを取り消せます。";

"READER_MODE_OPTION_TITLE" = "リーダーモード";
"READER_MODE_OPTION_DETAIL_TITLE" = "リーダーモードを有効にする";
"READER_MODE_OPTION_DETAIL_TITLE" = "リーダーモードを有効にします。";

"THEME_OPTION_TITLE" = "テーマ";
"THEME_OPTION_DETAIL_TITLE" = "Twitterのテーマカラーを変更できます。";
Expand All @@ -125,18 +125,21 @@
"CUSTOM_TAB_BAR_OPTION_5" = "通知";
"CUSTOM_TAB_BAR_OPTION_6" = "メッセージ";

"TWITTER_BLUE_SECTION_FOOTER_TITLE" = "変更を適応させるにはTwitterを再起動する必要があります。";
"TWITTER_BLUE_SECTION_FOOTER_TITLE" = "変更を適用させるにはTwitterを再起動する必要があります。";

"LAYOUT_CUS_SECTION_HEADER_TITLE" = "レイアウトのカスタム";
"ORIG_TWEET_STYLE_OPTION_TITLE" = "エッジツイートスタイルの無効化";
"ORIG_TWEET_STYLE_OPTION_DETAIL_TITLE" = "Twitterオリジナルスタイル";
"ORIG_TWEET_STYLE_OPTION_DETAIL_TITLE" = "Twitterオリジナルのスタイル";

"HIDE_VIEW_COUNT_OPTION_TITLE" = "表示回数を隠す";
"HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE" = "ツイートから表示回数を削除します。";

"FONT_OPTION_TITLE" = "カスタムフォントの有効化";
"FONT_OPTION_DETAIL_TITLE" = "カスタムフォントの設定を許可します。";
"FONT_OPTION_DETAIL_TITLE" = "Twitterのフォントを変更できるようにします。";

"REQULAR_FONTS_PICKER_OPTION_TITLE" = "フォント";
"BOLD_FONTS_PICKER_OPTION_TITLE" = "太字のフォント";
"LAYOUT_CUS_SECTION_FOOTER_TITLE" = "変更を適応させるにはTwitterを再起動する必要があります。";
"LAYOUT_CUS_SECTION_FOOTER_TITLE" = "変更を適用させるにはTwitterを再起動する必要があります。";

"DEBUG_SECTION_HEADER_TITLE" = "デバッグ";
"FLEX_OPTION_TITLE" = "FLEXの有効化";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,24 @@

"THEME_OPTION_TITLE" = "Тема";
"THEME_OPTION_DETAIL_TITLE" = "Позволяет сменить цветовую схему. Данную расцветку видите только вы";
"THEME_OPTION_1" = "Голубая";
"THEME_OPTION_2" = "Желтая";
"THEME_OPTION_3" = "Розовая";
"THEME_OPTION_4" = "Фиолетовая";
"THEME_OPTION_5" = "Оранжевая";
"THEME_OPTION_6" = "Зеленая";

"CUSTOM_TAB_BAR_OPTION_TITLE" = "Конфигурация вкладок";
"CUSTOM_TAB_BAR_REST_MESSAGE" = "Are sure you want to rest the settings to default?";
"CUSTOM_TAB_BAR_SECTION_1_TITLE" = "Активные вкладки";
"CUSTOM_TAB_BAR_SECTION_2_TITLE" = "Скрытые вкладки";
"CUSTOM_TAB_BAR_OPTION_1" = "Главная";
"CUSTOM_TAB_BAR_OPTION_2" = "Поиск";
"CUSTOM_TAB_BAR_OPTION_3" = "Аудиокомнаты";
"CUSTOM_TAB_BAR_OPTION_4" = "Сообщества";
"CUSTOM_TAB_BAR_OPTION_5" = "Уведомления";
"CUSTOM_TAB_BAR_OPTION_6" = "Сообщения";

"TWITTER_BLUE_SECTION_FOOTER_TITLE" = "Для вступления настроек в силу может потребоваться перезапуск приложения.";

"LAYOUT_CUS_SECTION_HEADER_TITLE" = "Декоративные настройки";
Expand All @@ -118,6 +134,9 @@
"FONT_OPTION_TITLE" = "Сменить шрифт";
"FONT_OPTION_DETAIL_TITLE" = "Позволяет установить кастомный шрифт";

"HIDE_VIEW_COUNT_OPTION_TITLE" = "Скрыть количество просмотров";
"HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE" = "Скрывает количество просмотров твита";

"REQULAR_FONTS_PICKER_OPTION_TITLE" = "Обычный шрифт";
"BOLD_FONTS_PICKER_OPTION_TITLE" = "Жирный шрифт";
"LAYOUT_CUS_SECTION_FOOTER_TITLE" = "Потребуется перезапуск приложения";
Expand All @@ -130,25 +149,3 @@
"LEGAL_BUTTON_TITLE" = "Лицензии используемых утилит";

"DEVELOPER_SECTION_HEADER_TITLE" = "Разработчик";

// Missing strings
"THEME_LABEL" = "Выберите цветовую схему:"; //Description inside theme option
"BLUE" = "Синяя";
"YELLOW" = "Желтая";
"RED" = "Розовая";
"PURPLE" = "Фиолетовая";
"ORANGE" = "Оранжевая";
"GREEN" = "Зеленая";
"ACTIVE_TABS" = "Активные вкладки"; //Inside custom tab bars option
"HIDDEN_TABS" = "Скрытые вкладки";
"HOME" = "Главная";
"EXPLORE" = "Поиск";
"SPACES" = "Аудиокомнаты";
"COMMUNITIES" = "Сообщества";
"NOTIFICATIONS" = "Уведомления";
"MESSAGES" = "Сообщения";
"HI" = "Ку-ку";
"ARE_YOU_SURE" = "Уверены, что хотите сбросить настройки вкладок?";
"YES" = "Да";
"NO" = "Нет";
"ARE_YOU_SURE_LABEL" = "Подтвердить действие?";
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
"THEME_OPTION_6" = "綠色";

"CUSTOM_TAB_BAR_OPTION_TITLE" = "自訂功能標籤";
"TWITTER_BLUE_SECTION_FOOTER_TITLE" = "必須重啟 Twitter 才能套用變更";
"CUSTOM_TAB_BAR_REST_MESSAGE" = "確定要將設定恢復為預設值嗎?";
"CUSTOM_TAB_BAR_SECTION_1_TITLE" = "使用中";
"CUSTOM_TAB_BAR_SECTION_2_TITLE" = "隱藏";
Expand All @@ -126,10 +125,15 @@
"CUSTOM_TAB_BAR_OPTION_5" = "通知";
"CUSTOM_TAB_BAR_OPTION_6" = "私人訊息";

"TWITTER_BLUE_SECTION_FOOTER_TITLE" = "必須重啟 Twitter 才能套用變更";

"LAYOUT_CUS_SECTION_HEADER_TITLE" = "佈局設定";
"ORIG_TWEET_STYLE_OPTION_TITLE" = "關閉邊到邊的推文樣示";
"ORIG_TWEET_STYLE_OPTION_DETAIL_TITLE" = "強制 Twitter 使用舊版推文樣式";

"HIDE_VIEW_COUNT_OPTION_TITLE" = "隱藏查看次數";
"HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE" = "在推文中隱藏查看次數";

"FONT_OPTION_TITLE" = "更換字體";
"FONT_OPTION_DETAIL_TITLE" = "啟用此選項,可以更換 Twitter 字體";

Expand All @@ -144,4 +148,4 @@
"LEGAL_SECTION_HEADER_TITLE" = "法律聲明";
"LEGAL_BUTTON_TITLE" = "致謝";

"DEVELOPER_SECTION_HEADER_TITLE" = "開發人員";
"DEVELOPER_SECTION_HEADER_TITLE" = "開發人員";
3 changes: 3 additions & 0 deletions BHTwitter/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ - (NSArray *)specifiers {

PSSpecifier *hideViewCount = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_VIEW_COUNT_OPTION_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"HIDE_VIEW_COUNT_OPTION_DETAIL_TITLE"] key:@"hide_view_count" defaultValue:false changeAction:nil];

PSSpecifier *tweetSource = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"SHOW_TWEET_SOURCE_TITLE"] detailTitle:nil key:@"show_tweet_source" defaultValue:false changeAction:nil];

PSSpecifier *font = [self newSwitchCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"FONT_OPTION_TITLE"] detailTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"FONT_OPTION_DETAIL_TITLE"] key:@"en_font" defaultValue:false changeAction:nil];

PSSpecifier *regularFontsPicker = [self newButtonCellWithTitle:[[BHTBundle sharedBundle] localizedStringForKey:@"REQULAR_FONTS_PICKER_OPTION_TITLE"] detailTitle:[[NSUserDefaults standardUserDefaults] objectForKey:@"bhtwitter_font_1"] dynamicRule:@"en_font, ==, 0" action:@selector(showRegularFontPicker:)];
Expand Down Expand Up @@ -252,6 +254,7 @@ - (NSArray *)specifiers {
layoutSection, // 2
origTweetStyle,
hideViewCount,
tweetSource,
font,
regularFontsPicker,
boldFontsPicker,
Expand Down

0 comments on commit a2f0741

Please sign in to comment.