summaryrefslogtreecommitdiffabout
path: root/kmicromail/libetpan/imap
Unidiff
Diffstat (limited to 'kmicromail/libetpan/imap') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libetpan/imap/mailimap.c2
-rw-r--r--kmicromail/libetpan/imap/mailimap_keywords.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/kmicromail/libetpan/imap/mailimap.c b/kmicromail/libetpan/imap/mailimap.c
index c8fbfee..76d9454 100644
--- a/kmicromail/libetpan/imap/mailimap.c
+++ b/kmicromail/libetpan/imap/mailimap.c
@@ -1886,49 +1886,49 @@ int mailimap_subscribe(mailimap * session, const char * mb)
1886 1886
1887 switch (error_code) { 1887 switch (error_code) {
1888 case MAILIMAP_RESP_COND_STATE_OK: 1888 case MAILIMAP_RESP_COND_STATE_OK:
1889 return MAILIMAP_NO_ERROR; 1889 return MAILIMAP_NO_ERROR;
1890 1890
1891 default: 1891 default:
1892 return MAILIMAP_ERROR_SUBSCRIBE; 1892 return MAILIMAP_ERROR_SUBSCRIBE;
1893 } 1893 }
1894} 1894}
1895 1895
1896int mailimap_unsubscribe(mailimap * session, const char * mb) 1896int mailimap_unsubscribe(mailimap * session, const char * mb)
1897{ 1897{
1898 struct mailimap_response * response; 1898 struct mailimap_response * response;
1899 int r; 1899 int r;
1900 int error_code; 1900 int error_code;
1901 1901
1902 if ((session->imap_state != MAILIMAP_STATE_AUTHENTICATED) && 1902 if ((session->imap_state != MAILIMAP_STATE_AUTHENTICATED) &&
1903 (session->imap_state != MAILIMAP_STATE_SELECTED)) 1903 (session->imap_state != MAILIMAP_STATE_SELECTED))
1904 return MAILIMAP_ERROR_BAD_STATE; 1904 return MAILIMAP_ERROR_BAD_STATE;
1905 1905
1906 r = send_current_tag(session); 1906 r = send_current_tag(session);
1907 if (r != MAILIMAP_NO_ERROR) 1907 if (r != MAILIMAP_NO_ERROR)
1908 return r; 1908 return r;
1909 1909
1910 r = mailimap_subscribe_send(session->imap_stream, mb); 1910 r = mailimap_unsubscribe_send(session->imap_stream, mb);
1911 if (r != MAILIMAP_NO_ERROR) 1911 if (r != MAILIMAP_NO_ERROR)
1912 return r; 1912 return r;
1913 1913
1914 r = mailimap_crlf_send(session->imap_stream); 1914 r = mailimap_crlf_send(session->imap_stream);
1915 if (r != MAILIMAP_NO_ERROR) 1915 if (r != MAILIMAP_NO_ERROR)
1916 return r; 1916 return r;
1917 1917
1918 if (mailstream_flush(session->imap_stream) == -1) 1918 if (mailstream_flush(session->imap_stream) == -1)
1919 return MAILIMAP_ERROR_STREAM; 1919 return MAILIMAP_ERROR_STREAM;
1920 1920
1921 if (read_line(session) == NULL) 1921 if (read_line(session) == NULL)
1922 return MAILIMAP_ERROR_STREAM; 1922 return MAILIMAP_ERROR_STREAM;
1923 1923
1924 r = parse_response(session, &response); 1924 r = parse_response(session, &response);
1925 if (r != MAILIMAP_NO_ERROR) 1925 if (r != MAILIMAP_NO_ERROR)
1926 return r; 1926 return r;
1927 1927
1928 error_code = response->rsp_resp_done->rsp_data.rsp_tagged->rsp_cond_state->rsp_type; 1928 error_code = response->rsp_resp_done->rsp_data.rsp_tagged->rsp_cond_state->rsp_type;
1929 1929
1930 mailimap_response_free(response); 1930 mailimap_response_free(response);
1931 1931
1932 switch (error_code) { 1932 switch (error_code) {
1933 case MAILIMAP_RESP_COND_STATE_OK: 1933 case MAILIMAP_RESP_COND_STATE_OK:
1934 return MAILIMAP_NO_ERROR; 1934 return MAILIMAP_NO_ERROR;
diff --git a/kmicromail/libetpan/imap/mailimap_keywords.c b/kmicromail/libetpan/imap/mailimap_keywords.c
index b277aed..4ec156e 100644
--- a/kmicromail/libetpan/imap/mailimap_keywords.c
+++ b/kmicromail/libetpan/imap/mailimap_keywords.c
@@ -32,49 +32,49 @@
32/* 32/*
33 * $Id$ 33 * $Id$
34 */ 34 */
35 35
36#include "mailimap_keywords.h" 36#include "mailimap_keywords.h"
37#include "mailimap_types.h" 37#include "mailimap_types.h"
38#include <string.h> 38#include <string.h>
39#include <stdio.h> 39#include <stdio.h>
40 40
41#ifndef UNSTRICT_SYNTAX 41#ifndef UNSTRICT_SYNTAX
42#define UNSTRICT_SYNTAX 42#define UNSTRICT_SYNTAX
43#endif 43#endif
44 44
45struct mailimap_token_value { 45struct mailimap_token_value {
46 int value; 46 int value;
47 const char * str; 47 const char * str;
48}; 48};
49 49
50int mailimap_token_case_insensitive_parse(mailstream * fd, 50int mailimap_token_case_insensitive_parse(mailstream * fd,
51 MMAPString * buffer, 51 MMAPString * buffer,
52 size_t * index, 52 size_t * index,
53 const char * token) 53 const char * token)
54{ 54{
55 int len; 55 int len;
56 int cur_token; 56 size_t cur_token;
57 int r; 57 int r;
58 58
59 cur_token = * index; 59 cur_token = * index;
60 len = strlen(token); 60 len = strlen(token);
61 61
62#ifdef UNSTRICT_SYNTAX 62#ifdef UNSTRICT_SYNTAX
63 r = mailimap_space_parse(fd, buffer, &cur_token); 63 r = mailimap_space_parse(fd, buffer, &cur_token);
64 if ((r != MAILIMAP_NO_ERROR) && (r != MAILIMAP_ERROR_PARSE)) 64 if ((r != MAILIMAP_NO_ERROR) && (r != MAILIMAP_ERROR_PARSE))
65 return r; 65 return r;
66#endif 66#endif
67 67
68 if (strncasecmp(buffer->str + cur_token, token, len) == 0) { 68 if (strncasecmp(buffer->str + cur_token, token, len) == 0) {
69 cur_token += len; 69 cur_token += len;
70 * index = cur_token; 70 * index = cur_token;
71 return MAILIMAP_NO_ERROR; 71 return MAILIMAP_NO_ERROR;
72 } 72 }
73 else 73 else
74 return MAILIMAP_ERROR_PARSE; 74 return MAILIMAP_ERROR_PARSE;
75} 75}
76 76
77 77
78static int is_space_or_tab(char ch) 78static int is_space_or_tab(char ch)
79{ 79{
80 return (ch == ' ') || (ch == '\t'); 80 return (ch == ' ') || (ch == '\t');