-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdcc_session.dart
More file actions
71 lines (67 loc) · 1.67 KB
/
dcc_session.dart
File metadata and controls
71 lines (67 loc) · 1.67 KB
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
enum DccSessionType { chat, send, unknown }
enum DccSessionStatus { pending, offering, connecting, connected, closed, failed }
class DccSession {
const DccSession({
required this.id,
required this.tabId,
required this.peerNick,
required this.type,
required this.status,
required this.direction,
this.filename,
this.host,
this.port,
this.size,
this.token,
this.filePath,
this.bytesTransferred = 0,
this.error,
});
final String id;
final String tabId;
final String peerNick;
final DccSessionType type;
final DccSessionStatus status;
final String direction;
final String? filename;
final String? host;
final int? port;
final int? size;
final String? token;
final String? filePath;
final int bytesTransferred;
final String? error;
DccSession copyWith({
String? id,
String? tabId,
String? peerNick,
DccSessionType? type,
DccSessionStatus? status,
String? direction,
String? filename,
String? host,
int? port,
int? size,
String? token,
String? filePath,
int? bytesTransferred,
String? error,
}) {
return DccSession(
id: id ?? this.id,
tabId: tabId ?? this.tabId,
peerNick: peerNick ?? this.peerNick,
type: type ?? this.type,
status: status ?? this.status,
direction: direction ?? this.direction,
filename: filename ?? this.filename,
host: host ?? this.host,
port: port ?? this.port,
size: size ?? this.size,
token: token ?? this.token,
filePath: filePath ?? this.filePath,
bytesTransferred: bytesTransferred ?? this.bytesTransferred,
error: error ?? this.error,
);
}
}