8000 [ruby/net-imap] Move flags to net/imap/flags · github/ruby@deae61e · GitHub
[go: up one dir, main page]

Skip to content

Commit deae61e

Browse files
nevanshsbt
authored andcommitted
[ruby/net-imap] Move flags to net/imap/flags
Partially implements #10. ruby/net-imap@2a9afa83bf
1 parent 337c0e3 commit deae61e

File tree

2 files changed

+57
-48
lines changed

2 files changed

+57
-48
lines changed

lib/net/imap.rb

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
require_relative "imap/command_data"
2626
require_relative "imap/data_encoding"
27+
require_relative "imap/flags"
2728
require_relative "imap/response_data"
2829
require_relative "imap/response_parser"
2930

@@ -238,43 +239,6 @@ class IMAP < Protocol
238239
# The thread to receive exceptions.
239240
attr_accessor :client_thread
240241

241-
# Flag indicating a message has been seen.
242-
SEEN = :Seen
243-
244-
# Flag indicating a message has been answered.
245-
ANSWERED = :Answered
246-
247-
# Flag indicating a message has been flagged for special or urgent
248-
# attention.
249-
FLAGGED = :Flagged
250-
251-
# Flag indicating a message has been marked for deletion. This
252-
# will occur when the mailbox is closed or expunged.
253-
DELETED = :Deleted
254-
255-
# Flag indicating a message is only a draft or work-in-progress version.
256-
DRAFT = :Draft
257-
258-
# Flag indicating that the message is "recent," meaning that this
259-
# session is the first session in which the client has been notified
260-
# of this message.
261-
RECENT = :Recent
262-
263-
# Flag indicating that a mailbox context name cannot contain
264-
# children.
265-
NOINFERIORS = :Noinferiors
266-
267-
# Flag indicating that a mailbox is not selected.
268-
NOSELECT = :Noselect
269-
270-
# Flag indicating that a mailbox has been marked "interesting" by
271-
# the server; this commonly indicates that the mailbox contains
272-
# new messages.
273-
MARKED = :Marked
274-
275-
# Flag indicating that the mailbox does not contains new messages.
276-
UNMARKED = :Unmarked
277-
278242
# Returns the debug mode.
279243
def self.debug
280244
return @@debug
@@ -285,16 +249,6 @@ def self.debug=(val)
285249
return @@debug = val
286250
end
287251

288-
# Returns the max number of flags interned to symbols.
289-
def self.max_flag_count
290-
return @@max_flag_count
291-
end
292-
293-
# Sets the max number of flags interned to symbols.
294-
def self.max_flag_count=(count)
295-
@@max_flag_count = count
296-
end
297-
298252
# The default port for IMAP connections, port 143
299253
def self.default_port
300254
return PORT
@@ -1062,7 +1016,6 @@ def idle_done
10621016
SSL_PORT = 993 # :nodoc:
10631017

10641018
@@debug = false
1065-
@@max_flag_count = 10000
10661019

10671020
# :call-seq:
10681021
# Net::IMAP.new(host, options = {})

lib/net/imap/flags.rb

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# frozen_string_literal: true
2+
3+
module Net
4+
class IMAP < Protocol
5+
6+
# Flag indicating a message has been seen.
7+
SEEN = :Seen
8+
9+
# Flag indicating a message has been answered.
10+
ANSWERED = :Answered
11+
12+
# Flag indicating a message has been flagged for special or urgent
13+
# attention.
14+
FLAGGED = :Flagged
15+
16+
# Flag indicating a message has been marked for deletion. This
17+
# will occur when the mailbox is closed or expunged.
18+
DELETED = :Deleted
19+
20+
# Flag indicating a message is only a draft or work-in-progress version.
21+
DRAFT = :Draft
22+
23+
# Flag indicating that the message is "recent," meaning that this
24+
# session is the first session in which the client has been notified
25+
# of this message.
26+
RECENT = :Recent
27+
28+
# Flag indicating that a mailbox context name cannot contain
29+
# children.
30+
NOINFERIORS = :Noinferiors
31+
32+
# Flag indicating that a mailbox is not selected.
33+
NOSELECT = :Noselect
34+
35+
# Flag indicating that a mailbox has been marked "interesting" by
36+
# the server; this commonly indicates that the mailbox contains
37+
# new messages.
38+
MARKED = :Marked
39+
40+
# Flag indicating that the mailbox does not contains new messages.
41+
UNMARKED = :Unmarked
42+
43+
@@max_flag_count = 10000
44+
45+
# Returns the max number of flags interned to symbols.
46+
def self.max_flag_count
47+
return @@max_flag_count
48+
end
49+
50+
# Sets the max number of flags interned to symbols.
51+
def self.max_flag_count=(count)
52+
@@max_flag_count = count
53+
end
54+
55+
end
56+
end

0 commit comments

Comments
 (0)
0