forked from NozeIO/swift-nio-irc-client-original-fork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIRCClientDelegate.swift
75 lines (59 loc) · 2.73 KB
/
IRCClientDelegate.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//===----------------------------------------------------------------------===//
//
// This source file is part of the swift-nio-irc open source project
//
// Copyright (c) 2018 ZeeZide GmbH. and the swift-nio-irc project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftNIOIRC project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
/**
* Delegate methods called by `IRCClient` upon receiving IRC commands.
*/
public protocol IRCClientDelegate {
func client(_ client : IRCClient,
registered nick : IRCNickName,
with userInfo : IRCUserInfo)
func clientFailedToRegister(_ client: IRCClient)
func client(_ client: IRCClient, received message: IRCMessage)
func client(_ client: IRCClient, messageOfTheDay: String)
func client(_ client: IRCClient, notice message: String,
for recipients: [ IRCMessageRecipient ])
func client(_ client: IRCClient,
message: String, from user: IRCUserID,
for recipients: [ IRCMessageRecipient ])
func client(_ client: IRCClient, changedUserModeTo mode: IRCUserMode)
func client(_ client: IRCClient, changedNickTo nick: IRCNickName)
func client(_ client: IRCClient, user: IRCUserID, joined: [ IRCChannelName ])
func client(_ client: IRCClient, user: IRCUserID, left: [ IRCChannelName ],
with: String?)
func client(_ client: IRCClient,
changeTopic: String, of channel: IRCChannelName)
}
// MARK: - Default No-Op Implementations
public extension IRCClientDelegate {
func client(_ client: IRCClient, registered nick: IRCNickName,
with userInfo: IRCUserInfo) {}
func client(_ client: IRCClient, received message: IRCMessage) {}
func clientFailedToRegister(_ client: IRCClient) {}
func client(_ client: IRCClient, messageOfTheDay: String) {}
func client(_ client: IRCClient,
notice message: String,
for recipients: [ IRCMessageRecipient ]) {}
func client(_ client: IRCClient,
message: String, from sender: IRCUserID,
for recipients: [ IRCMessageRecipient ]) {}
func client(_ client: IRCClient, changedUserModeTo mode: IRCUserMode) {}
func client(_ client: IRCClient, changedNickTo nick: IRCNickName) {}
func client(_ client: IRCClient,
user: IRCUserID, joined channels: [ IRCChannelName ]) {}
func client(_ client: IRCClient,
user: IRCUserID, left channels: [ IRCChannelName ],
with message: String?) {}
func client(_ client: IRCClient,
changeTopic: String, of channel: IRCChannelName) {}
}