Differences From Artifact [002f1423f2]:
- File
src/IRCConnection.m
— part of check-in
[620b9b2a30]
at
2012-11-24 11:56:58
on branch trunk
— Remove the IRCChannels class.
It was only overcomplicating things with no gain at all. Instead,
strings are used to describe channels now and the storage of users in a
channel is inside IRCConnection now. (user: js, size: 14919) [annotate] [blame] [check-ins using]
To Artifact [08dd759998]:
- File
src/IRCConnection.m
— part of check-in
[2cc7844016]
at
2012-11-28 21:30:19
on branch trunk
— Make sure no newlines from parameters are sent.
Not doing so would allow hijacking a connection. (user: js, size: 15719) [annotate] [blame] [check-ins using]
︙ | |||
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | + + + + + + + | - (void)disconnect { [self disconnectWithReason: nil]; } - (void)disconnectWithReason: (OFString*)reason { reason = [[reason componentsSeparatedByString: @"\n"] firstObject]; if (reason == nil) [self sendLine: @"QUIT"]; else [self sendLineWithFormat: @"QUIT :%@", reason]; } - (void)joinChannel: (OFString*)channel { channel = [[channel componentsSeparatedByString: @"\n"] firstObject]; [self sendLineWithFormat: @"JOIN %@", channel]; } - (void)leaveChannel: (OFString*)channel { [self leaveChannel: channel reason: nil]; } - (void)leaveChannel: (OFString*)channel reason: (OFString*)reason { channel = [[channel componentsSeparatedByString: @"\n"] firstObject]; reason = [[reason componentsSeparatedByString: @"\n"] firstObject]; if (reason == nil) [self sendLineWithFormat: @"PART %@", channel]; else [self sendLineWithFormat: @"PART %@ :%@", channel, reason]; [channels removeObjectForKey: channel]; } |
︙ | |||
190 191 192 193 194 195 196 | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | + + + + + - + + + + + + - + + + + + + | [pool release]; } - (void)sendMessage: (OFString*)msg to: (OFString*)to { OFArray *lines = [msg componentsSeparatedByString: @"\n"]; OFEnumerator *enumerator = [lines objectEnumerator]; OFString *line; while ((line = [enumerator nextObject]) != nil) |
︙ |