Bug Summary

File:Plugins/Purple Service/DCPurpleZephyrJoinChatViewController.m
Location:line 63, column 3
Description:dead store

Annotated Source Code

1/*
2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
4 *
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
10 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 * Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 */
16
17#import "DCPurpleZephyrJoinChatViewController.h"
18#import "DCJoinChatWindowController.h"
19#import <Adium/AIAccount.h>
20
21@interface DCPurpleZephyrJoinChatViewController (PRIVATE)
22- (void)validateEnteredText;
23@end
24
25@implementation DCPurpleZephyrJoinChatViewController
26
27- (NSString *)nibName
28{
29 return @"DCPurpleZephyrJoinChatView";
30}
31
32- (void)configureForAccount:(AIAccount *)inAccount
33{
34 [self validateEnteredText];
35
36 [[view window] makeFirstResponder:textField_class];
37
38 [super configureForAccount:inAccount];
39}
40
41/*
42 Zephyr uses "class" "instance" and "recipient". Instance and Recipient are optional and will become "*" if
43 they are not specified; we show this default value automatically for clarity.
44 */
45
46- (void)joinChatWithAccount:(AIAccount *)inAccount
47{
48 NSString *class;
49 NSString *instance;
50 NSString *recipient;
51 NSDictionary *chatCreationInfo;
52
53 class = [textField_class stringValue];
54 instance = [textField_instance stringValue];
55 recipient = [textField_recipient stringValue];
56
57 if (!instance || ![instance length]) instance = @"*";
58 if (!recipient || ![recipient length]) recipient = @"*";
59
60 if (class && [class length]) {
61 NSString *name;
62 //The chatCreationInfo has keys corresponding to the GHashTable keys and values to match them.
Value stored to 'chatCreationInfo' is never read
63 chatCreationInfo = [NSMutableDictionary dictionaryWithObject:class
64 forKey:@"class"];
65
66 //The chatCreationInfo has keys corresponding to the GHashTable keys and values to match them.
67 chatCreationInfo = [NSDictionary dictionaryWithObjectsAndKeys:class,@"class",instance,@"instance",recipient,@"recipient",nil0];
68
69 name = [NSString stringWithFormat:@"%@,%@,%@",class,instance,recipient];
70
71 [self doJoinChatWithName:name
72 onAccount:inAccount
73 chatCreationInfo:chatCreationInfo
74 invitingContacts:nil0
75 withInvitationMessage:nil0];
76 }
77}
78
79//Entered text is changing
80- (void)controlTextDidChange:(NSNotification *)notification
81{
82 if ([notification object] == textField_class) {
83 [self validateEnteredText];
84 }
85}
86
87- (void)validateEnteredText
88{
89 NSString *class = [textField_class stringValue];
90 BOOL enabled = NO( BOOL ) 0;
91
92 if (class && [class length]) {
93 enabled = YES( BOOL ) 1;
94 }
95
96 if (delegate)
97 [(DCJoinChatWindowController *)delegate setJoinChatEnabled:enabled];
98}
99
100@end