File tree Expand file tree Collapse file tree 3 files changed +4
-34
lines changed Expand file tree Collapse file tree 3 files changed +4
-34
lines changed Original file line number Diff line number Diff line change @@ -95,5 +95,7 @@ Initial release
95
95
96
96
### v2
97
97
98
- CTCP messages will no longer be rewritten. The decision was made that this
99
- library should not rewrite messages.
98
+ - CTCP messages will no longer be rewritten. The decision was made that this
99
+ library should pass through all messages without mangling them.
100
+ - Remove Message.FromChannel as this is not always accurate, while
101
+ Client.FromChannel should always be accurate.
Original file line number Diff line number Diff line change @@ -325,25 +325,6 @@ func (m *Message) Trailing() string {
325
325
return m .Params [len (m .Params )- 1 ]
326
326
}
327
327
328
- // FromChannel is mostly for PRIVMSG messages (and similar derived
329
- // messages) It will check if the message came from a channel or a
330
- // person. This is not always accurate, because some servers allow for
331
- // other characters at the start of a channel.
332
- //
333
- // TODO: Remove in favor of *Client.FromChannel(*Message)
334
- func (m * Message ) FromChannel () bool {
335
- if len (m .Params ) < 1 || len (m .Params [0 ]) < 1 {
336
- return false
337
- }
338
-
339
- switch m .Params [0 ][0 ] {
340
- case '#' , '&' :
341
- return true
342
- default :
343
- return false
344
- }
345
- }
346
-
347
328
// Copy will create a new copy of an message
348
329
func (m * Message ) Copy () * Message {
349
330
// Create a new message
Original file line number Diff line number Diff line change @@ -68,19 +68,6 @@ func TestMessageTrailing(t *testing.T) {
68
68
assert .Equal (t , "" , m .Trailing ())
69
69
}
70
70
71
- func TestMessageFromChan (t * testing.T ) {
72
- t .Parallel ()
73
-
74
- m := MustParseMessage ("PRIVMSG #test-msg :hello world" )
75
- assert .True (t , m .FromChannel (), "Wrong FromChannel value" )
76
-
77
- m = MustParseMessage ("PRIVMSG bot :hello world" )
78
- assert .False (t , m .FromChannel (), "Wrong FromChannel value" )
79
-
80
- m = MustParseMessage ("PING" )
81
- assert .False (t , m .FromChannel (), "Wrong FromChannel value" )
82
- }
83
-
84
71
func TestMessageCopy (t * testing.T ) {
85
72
t .Parallel ()
86
73
You can’t perform that action at this time.
0 commit comments