mirror of
				https://github.com/fluffle/goirc
				synced 2025-11-04 03:58:03 +00:00 
			
		
		
		
	Merge 2cc4e94acb into aa021c7cac
				
					
				
			This commit is contained in:
		
						commit
						63ea81094d
					
				
					 2 changed files with 36 additions and 0 deletions
				
			
		| 
						 | 
					@ -210,6 +210,24 @@ func (ch *Channel) ParseModes(modes string, modeargs ...string) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Nicks returns a list of *Nick that are on the channel.
 | 
				
			||||||
 | 
					func (ch *Channel) Nicks() []*Nick {
 | 
				
			||||||
 | 
						nicks := make([]*Nick, 0, len(ch.lookup))
 | 
				
			||||||
 | 
						for _, nick := range ch.lookup {
 | 
				
			||||||
 | 
							nicks = append(nicks, nick)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return nicks
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// NicksStr returns a list of nick strings that are on the channel.
 | 
				
			||||||
 | 
					func (ch *Channel) NicksStr() []string {
 | 
				
			||||||
 | 
						nicks := make([]string, 0, len(ch.lookup))
 | 
				
			||||||
 | 
						for _, nick := range ch.lookup {
 | 
				
			||||||
 | 
							nicks = append(nicks, nick.Nick)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return nicks
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Returns a string representing the channel. Looks like:
 | 
					// Returns a string representing the channel. Looks like:
 | 
				
			||||||
//	Channel: <channel name> e.g. #moo
 | 
					//	Channel: <channel name> e.g. #moo
 | 
				
			||||||
//	Topic: <channel topic> e.g. Discussing the merits of cows!
 | 
					//	Topic: <channel topic> e.g. Discussing the merits of cows!
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -110,6 +110,24 @@ func (nk *Nick) ParseModes(modes string) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Channels returns a list of *Channel the nick is on.
 | 
				
			||||||
 | 
					func (nk *Nick) Channels() []*Channel {
 | 
				
			||||||
 | 
						channels := make([]*Channel, 0, len(nk.lookup))
 | 
				
			||||||
 | 
						for _, channel := range nk.lookup {
 | 
				
			||||||
 | 
							channels = append(channels, channel)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return channels
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ChannelsStr returns a list of channel strings the nick is on.
 | 
				
			||||||
 | 
					func (nk *Nick) ChannelsStr() []string {
 | 
				
			||||||
 | 
						channels := make([]string, 0, len(nk.lookup))
 | 
				
			||||||
 | 
						for _, channel := range nk.lookup {
 | 
				
			||||||
 | 
							channels = append(channels, channel.Name)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return channels
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Returns a string representing the nick. Looks like:
 | 
					// Returns a string representing the nick. Looks like:
 | 
				
			||||||
//	Nick: <nick name> e.g. CowMaster
 | 
					//	Nick: <nick name> e.g. CowMaster
 | 
				
			||||||
//	Hostmask: <ident@host> e.g. moo@cows.org
 | 
					//	Hostmask: <ident@host> e.g. moo@cows.org
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue