| 335 | } |
| 336 | |
| 337 | func (m *ircModel) applyChanLine(msg ircChanLineMsg) { |
| 338 | if !m.ready { |
| 339 | if s := m.servers[msg.id]; s != nil { |
| 340 | s.queued = append(s.queued, msg) |
| 341 | } |
| 342 | return |
| 343 | } |
| 344 | if s, ok := m.servers[msg.id]; ok { |
| 345 | if s.channelLogs == nil { |
| 346 | s.channelLogs = make(map[string][]string) |
| 347 | } |
| 348 | ch := msg.channel |
| 349 | if ch == "" { |
| 350 | ch = "_sys" |
| 351 | } |
| 352 | s.channelLogs[ch] = append(s.channelLogs[ch], msg.line) |
| 353 | |
| 354 | if m.mode == modeChat && m.activeID == msg.id && m.activeChan == ch { |
| 355 | m.refreshChat() |
| 356 | } |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | func (m *ircModel) pushSysLine(id serverID, ch, txt string) { |
| 361 | if s := m.servers[id]; s != nil { |