Changeset 2f2644f03203b36fd6aa105e62f4cd15070e1cbe
- Timestamp:
- 08/10/08 01:26:03
(3 months ago)
- Author:
- Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
- git-committer:
- Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1218317163 +0200
- git-parent:
[58b43c90ef7435713213015848eaf0486fab0b8f]
- git-author:
- Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1218317163 +0200
- Message:
+ support channel URL and creation time
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra915f36 |
r2f2644f |
|
| 1300 | 1300 | attr_reader :name, :topic, :mode, :users |
|---|
| 1301 | 1301 | alias :to_s :name |
|---|
| | 1302 | attr_accessor :creation_time, :url |
|---|
| 1302 | 1303 | |
|---|
| 1303 | 1304 | def inspect |
|---|
| … | … | |
| 1306 | 1307 | str << " @name=#{@name.inspect} @topic=#{@topic.text.inspect}" |
|---|
| 1307 | 1308 | str << " @users=[#{user_nicks.sort.join(', ')}]" |
|---|
| | 1309 | str << " (created on #{creation_time})" if creation_time |
|---|
| | 1310 | str << " (URL #{url})" if url |
|---|
| 1308 | 1311 | str << ">" |
|---|
| 1309 | 1312 | end |
|---|
| … | … | |
| 1369 | 1372 | # Flags |
|---|
| 1370 | 1373 | @mode = ModeHash.new |
|---|
| | 1374 | |
|---|
| | 1375 | # creation time, only on some networks |
|---|
| | 1376 | @creation_time = nil |
|---|
| | 1377 | |
|---|
| | 1378 | # URL, only on some networks |
|---|
| | 1379 | @url = nil |
|---|
| 1371 | 1380 | end |
|---|
| 1372 | 1381 | |
|---|
| rd5b21e2 |
r2f2644f |
|
| 144 | 144 | # "<channel> <mode> <mode params>" |
|---|
| 145 | 145 | RPL_CHANNELMODEIS=324 |
|---|
| | 146 | |
|---|
| | 147 | # "<channel> <unixtime>" |
|---|
| | 148 | RPL_CREATIONTIME=329 |
|---|
| | 149 | |
|---|
| | 150 | # "<channel> <url>" |
|---|
| | 151 | RPL_CHANNEL_URL=328 |
|---|
| 146 | 152 | |
|---|
| 147 | 153 | # "<channel> :No topic is set" |
|---|
| … | … | |
| 1280 | 1286 | parse_mode(serverstring, argv[1..-1], data) |
|---|
| 1281 | 1287 | handle(:mode, data) |
|---|
| | 1288 | when RPL_CREATIONTIME |
|---|
| | 1289 | data[:channel] = argv[1] |
|---|
| | 1290 | data[:time] = Time.at(argv[2].to_i) |
|---|
| | 1291 | @server.get_channel(data[:channel]).creation_time=data[:time] |
|---|
| | 1292 | handle(:creationtime, data) |
|---|
| | 1293 | when RPL_CHANNEL_URL |
|---|
| | 1294 | data[:channel] = argv[1] |
|---|
| | 1295 | data[:url] = argv[2] |
|---|
| | 1296 | @server.get_channel(data[:channel]).url=data[:url].dup |
|---|
| | 1297 | handle(:channel_url, data) |
|---|
| 1282 | 1298 | else |
|---|
| 1283 | 1299 | warning "Unknown message #{serverstring.inspect}" |
|---|