@@ -103,7 +103,6 @@ - (void)_printActionChat:(NSString *)chat by:(WCUser *)user;
103103- (void )_printHTML : (NSString *)html by : (WCUser *)user ;
104104
105105- (void )_sendImage : (NSURL *)url ;
106- - (void )_sendYouTube : (NSURL *)url ;
107106- (void )_sendiTunes ;
108107
109108- (NSArray *)_commands ;
@@ -495,52 +494,6 @@ - (void)_sendLocalImage:(NSURL *)url {
495494}
496495
497496
498- - (void )_sendYouTube : (NSURL *)url {
499- NSString *html = nil , *videoID;
500- NSArray *parameters;
501- WIP7Message *message;
502-
503- if ([[url scheme ] containsSubstring: @" https" ]) {
504-
505- if ([[url host ] containsSubstring: @" youtu.be" ])
506- videoID = [[url absoluteString ] lastPathComponent ];
507-
508- else if ([[url host ] containsSubstring: @" youtube.com" ]) {
509- parameters = [[url query ] componentsSeparatedByString: @" &" ];
510-
511- for (NSString * pair in parameters) {
512- NSArray * bits = [pair componentsSeparatedByString: @" =" ];
513- NSString * key = [[bits objectAtIndex: 0 ] stringByReplacingPercentEscapesUsingEncoding: NSASCIIStringEncoding];
514- NSString * value = [[bits objectAtIndex: 1 ] stringByReplacingPercentEscapesUsingEncoding: NSASCIIStringEncoding];
515-
516- if ([key isEqualToString: @" v" ]) {
517- videoID = value;
518- continue ;
519- }
520- }
521- } else
522- videoID = nil ;
523-
524- // NSLog(@"videoID : %@", videoID);
525-
526- if (videoID)
527- html = [NSSWF:@" <div class='chat-media-frame'><iframe width='300' height='233' src='https://www.youtube.com/embed/%@ ' frameborder='0' allowfullscreen></iframe></div>" , videoID];
528- } else {
529- html = nil ;
530- }
531-
532- if (html && [html length ] > 0 ) {
533- message = [WIP7Message messageWithName: @" wired.chat.send_me" spec: WCP7Spec];
534- [message setUInt32: [self chatID ] forName: @" wired.chat.id" ];
535- [message setString: html forName: @" wired.chat.me" ];
536- [[self connection ] sendMessage: message];
537- }
538- }
539-
540- // https://youtu.be/rynxqdNMry4
541- // <div class="video-container"><iframe src="https://www.youtube-nocookie.com/embed/LJUaJ5PSXGE?rel=0" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
542-
543-
544497
545498
546499#pragma mark -
@@ -559,10 +512,7 @@ - (NSArray *)_commands {
559512 @" /ping" ,
560513 @" /afk" ,
561514 @" /img" ,
562- @" /html" ,
563515 @" /itunes" ,
564- @" /youtube" ,
565- @" /utube" ,
566516 NULL ];
567517}
568518
@@ -678,32 +628,11 @@ - (BOOL)_runCommand:(NSString *)string {
678628
679629 return YES ;
680630 }
681- else if ([command isEqualToString: @" /html" ]) {
682- if (argument && [argument length ] > 0 ) {
683- if ([[self class ] checkHTMLRestrictionsForString: argument]) {
684- message = [WIP7Message messageWithName: @" wired.chat.send_say" spec: WCP7Spec];
685- [message setUInt32: [self chatID ] forName: @" wired.chat.id" ];
686- [message setString: argument forName: @" wired.chat.say" ];
687- [[self connection ] sendMessage: message];
688- }
689- }
690- return YES ;
691- }
692631 else if ([command isEqualToString: @" /itunes" ]) {
693632 [self _sendiTunes ];
694633
695634 return YES ;
696635 }
697- else if ([command isEqualToString: @" /youtube" ] || [command isEqualToString: @" /utube" ]) {
698- if (argument && [argument length ] > 0 ) {
699- NSURL *url = [NSURL URLWithString: argument];
700-
701- if (url)
702- [self _sendYouTube: url];
703- }
704-
705- return YES ;
706- }
707636
708637 return NO ;
709638}
@@ -1203,10 +1132,8 @@ - (void)appleInterfaceThemeChanged:(NSNotification *) notification {
12031132 NSDictionary *theme;
12041133
12051134 if ([NSApp darkModeEnabled ]) {
1206- NSLog (@" dark" );
12071135 theme = [[WCSettings settings ] themeWithName: @" Dark" ];
12081136 } else {
1209- NSLog (@" light" );
12101137 theme = [[WCSettings settings ] themeWithName: @" Light" ];
12111138 }
12121139
@@ -1217,7 +1144,7 @@ - (void)appleInterfaceThemeChanged:(NSNotification *) notification {
12171144
12181145
12191146
1220- - (void )themeDidChange : (NSDictionary *)theme {
1147+ - (void )themeDidChange : (NSDictionary *)theme {
12211148 WITemplateBundle *templateBundle;
12221149 NSColor *textColor, *backgroundColor, *timestampColor, *eventColor, *urlColor;
12231150 NSFont *font;
@@ -1306,11 +1233,11 @@ - (void)themeDidChange:(NSDictionary *)theme {
13061233 toAttribute: WITemplateAttributesFontSize
13071234 ofType: WITemplateTypeChat];
13081235
1309- [templateBundle setCSSValue: [NSSWF: @" # %.6lx " , ( unsigned long )[textColor HTMLValue ]]
1236+ [templateBundle setCSSValue: [NSApp darkModeEnabled ] ? @" white " : @" dimgray "
13101237 toAttribute: WITemplateAttributesFontColor
13111238 ofType: WITemplateTypeChat];
13121239
1313- [templateBundle setCSSValue: [NSSWF: @" #%.6lx " , ( unsigned long )[backgroundColor HTMLValue ]]
1240+ [templateBundle setCSSValue: [NSApp darkModeEnabled ] ? @" #383838 " : @" white "
13141241 toAttribute: WITemplateAttributesBackgroundColor
13151242 ofType: WITemplateTypeChat];
13161243
0 commit comments