@@ -1019,7 +1019,7 @@ def clear_cached_capabilities
1019
1019
def capability
1020
1020
synchronize do
1021
1021
send_command ( "CAPABILITY" )
1022
- @capabilities = @responses . delete ( "CAPABILITY" ) . last . freeze
1022
+ @capabilities = clear_responses ( "CAPABILITY" ) . last . freeze
1023
1023
end
1024
1024
end
1025
1025
@@ -1048,7 +1048,7 @@ def capability
1048
1048
def id ( client_id = nil )
1049
1049
synchronize do
1050
1050
send_command ( "ID" , ClientID . new ( client_id ) )
1051
- @responses . delete ( "ID" ) & .last
1051
+ clear_responses ( "ID" ) . last
1052
1052
end
1053
1053
end
1054
1054
@@ -1444,7 +1444,7 @@ def unsubscribe(mailbox)
1444
1444
def list ( refname , mailbox )
1445
1445
synchronize do
1446
1446
send_command ( "LIST" , refname , mailbox )
1447
- return @responses . delete ( "LIST" )
1447
+ clear_responses ( "LIST" )
1448
1448
end
1449
1449
end
1450
1450
@@ -1501,7 +1501,7 @@ def list(refname, mailbox)
1501
1501
def namespace
1502
1502
synchronize do
1503
1503
send_command ( "NAMESPACE" )
1504
- return @responses . delete ( "NAMESPACE" ) [ - 1 ]
1504
+ clear_responses ( "NAMESPACE" ) . last
1505
1505
end
1506
1506
end
1507
1507
@@ -1545,7 +1545,7 @@ def namespace
1545
1545
def xlist ( refname , mailbox )
1546
1546
synchronize do
1547
1547
send_command ( "XLIST" , refname , mailbox )
1548
- return @responses . delete ( "XLIST" )
1548
+ clear_responses ( "XLIST" )
1549
1549
end
1550
1550
end
1551
1551
@@ -1564,8 +1564,8 @@ def getquotaroot(mailbox)
1564
1564
synchronize do
1565
1565
send_command ( "GETQUOTAROOT" , mailbox )
1566
1566
result = [ ]
1567
- result . concat ( @responses . delete ( "QUOTAROOT" ) )
1568
- result . concat ( @responses . delete ( "QUOTA" ) )
1567
+ result . concat ( clear_responses ( "QUOTAROOT" ) )
1568
+ result . concat ( clear_responses ( "QUOTA" ) )
1569
1569
return result
1570
1570
end
1571
1571
end
@@ -1584,7 +1584,7 @@ def getquotaroot(mailbox)
1584
1584
def getquota ( mailbox )
1585
1585
synchronize do
1586
1586
send_command ( "GETQUOTA" , mailbox )
1587
- return @responses . delete ( "QUOTA" )
1587
+ clear_responses ( "QUOTA" )
1588
1588
end
1589
1589
end
1590
1590
@@ -1640,7 +1640,7 @@ def setacl(mailbox, user, rights)
1640
1640
def getacl ( mailbox )
1641
1641
synchronize do
1642
1642
send_command ( "GETACL" , mailbox )
1643
- return @responses . delete ( "ACL" ) [ - 1 ]
1643
+ clear_responses ( "ACL" ) . last
1644
1644
end
1645
1645
end
1646
1646
@@ -1655,7 +1655,7 @@ def getacl(mailbox)
1655
1655
def lsub ( refname , mailbox )
1656
1656
synchronize do
1657
1657
send_command ( "LSUB" , refname , mailbox )
1658
- return @responses . delete ( "LSUB" )
1658
+ clear_responses ( "LSUB" )
1659
1659
end
1660
1660
end
1661
1661
@@ -1679,7 +1679,7 @@ def lsub(refname, mailbox)
1679
1679
def status ( mailbox , attr )
1680
1680
synchronize do
1681
1681
send_command ( "STATUS" , mailbox , attr )
1682
- return @responses . delete ( "STATUS" ) [ - 1 ] . attr
1682
+ clear_responses ( "STATUS" ) . last & .attr
1683
1683
end
1684
1684
end
1685
1685
@@ -1768,7 +1768,7 @@ def unselect
1768
1768
def expunge
1769
1769
synchronize do
1770
1770
send_command ( "EXPUNGE" )
1771
- return @responses . delete ( "EXPUNGE" )
1771
+ clear_responses ( "EXPUNGE" )
1772
1772
end
1773
1773
end
1774
1774
@@ -1800,7 +1800,7 @@ def expunge
1800
1800
def uid_expunge ( uid_set )
1801
1801
synchronize do
1802
1802
send_command ( "UID EXPUNGE" , MessageSet . new ( uid_set ) )
1803
- return @responses . delete ( "EXPUNGE" )
1803
+ clear_responses ( "EXPUNGE" )
1804
1804
end
1805
1805
end
1806
1806
@@ -2188,7 +2188,7 @@ def enable(*capabilities)
2188
2188
. join ( ' ' )
2189
2189
synchronize do
2190
2190
send_command ( "ENABLE #{ capabilities } " )
2191
- result = @responses . delete ( "ENABLED" ) [ - 1 ]
2191
+ result = clear_responses ( "ENABLED" ) . last
2192
2192
@utf8_strings ||= result . include? "UTF8=ACCEPT"
2193
2193
@utf8_strings ||= result . include? "IMAP4REV2"
2194
2194
result
@@ -2641,7 +2641,7 @@ def search_internal(cmd, keys, charset)
2641
2641
else
2642
2642
send_command ( cmd , *keys )
2643
2643
end
2644
- return @responses . delete ( "SEARCH" ) [ - 1 ]
2644
+ clear_responses ( "SEARCH" ) . last
2645
2645
end
2646
2646
end
2647
2647
@@ -2656,13 +2656,13 @@ def fetch_internal(cmd, set, attr, mod = nil)
2656
2656
end
2657
2657
2658
2658
synchronize do
2659
- @responses . delete ( "FETCH" )
2659
+ clear_responses ( "FETCH" )
2660
2660
if mod
2661
2661
send_command ( cmd , MessageSet . new ( set ) , attr , mod )
2662
2662
else
2663
2663
send_command ( cmd , MessageSet . new ( set ) , attr )
2664
2664
end
2665
- return @responses . delete ( "FETCH" )
2665
+ clear_responses ( "FETCH" )
2666
2666
end
2667
2667
end
2668
2668
@@ -2671,9 +2671,9 @@ def store_internal(cmd, set, attr, flags)
2671
2671
attr = RawData . new ( attr )
2672
2672
end
2673
2673
synchronize do
2674
- @responses . delete ( "FETCH" )
2674
+ clear_responses ( "FETCH" )
2675
2675
send_command ( cmd , MessageSet . new ( set ) , attr , flags )
2676
- return @responses . delete ( "FETCH" )
2676
+ clear_responses ( "FETCH" )
2677
2677
end
2678
2678
end
2679
2679
@@ -2690,7 +2690,7 @@ def sort_internal(cmd, sort_keys, search_keys, charset)
2690
2690
normalize_searching_criteria ( search_keys )
2691
2691
synchronize do
2692
2692
send_command ( cmd , sort_keys , charset , *search_keys )
2693
- return @responses . delete ( "SORT" ) [ - 1 ]
2693
+ clear_responses ( "SORT" ) . last
2694
2694
end
2695
2695
end
2696
2696
@@ -2703,7 +2703,7 @@ def thread_internal(cmd, algorithm, search_keys, charset)
2703
2703
normalize_searching_criteria ( search_keys )
2704
2704
synchronize do
2705
2705
send_command ( cmd , algorithm , charset , *search_keys )
2706
- @responses . delete ( "THREAD" ) [ - 1 ]
2706
+ clear_responses ( "THREAD" ) . last
2707
2707
end
2708
2708
end
2709
2709
0 commit comments