Changeset 684 in code for trunk/irc.go
- Timestamp:
- Nov 15, 2021, 1:34:04 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/irc.go
r673 r684 409 409 } 410 410 411 func generateMonitor(subcmd string, targets []string) []*irc.Message { 412 maxLength := maxMessageLength - len("MONITOR "+subcmd+" ") 413 414 var msgs []*irc.Message 415 var buf []string 416 n := 0 417 for _, target := range targets { 418 if n+len(target)+1 > maxLength { 419 msgs = append(msgs, &irc.Message{ 420 Command: "MONITOR", 421 Params: []string{subcmd, strings.Join(buf, ",")}, 422 }) 423 buf = buf[:0] 424 n = 0 425 } 426 427 buf = append(buf, target) 428 n += len(target) + 1 429 } 430 431 if len(buf) > 0 { 432 msgs = append(msgs, &irc.Message{ 433 Command: "MONITOR", 434 Params: []string{subcmd, strings.Join(buf, ",")}, 435 }) 436 } 437 438 return msgs 439 } 440 411 441 type joinSorter struct { 412 442 channels []string … … 635 665 } 636 666 667 type monitorCasemapMap struct{ casemapMap } 668 669 func (cm *monitorCasemapMap) Value(name string) (online bool) { 670 entry, ok := cm.innerMap[cm.casemap(name)] 671 if !ok { 672 return false 673 } 674 return entry.value.(bool) 675 } 676 637 677 func isWordBoundary(r rune) bool { 638 678 switch r {
Note:
See TracChangeset
for help on using the changeset viewer.