Changeset 814bafc in github
- Timestamp:
- Dec 27, 2010 9:50:21 AM (2 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- a63b36a
- Parents:
- dd944d9
- Files:
-
- 2 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_imap_generic.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r1c7b94b5 r814bafc 4 4 - Show the same message only once (#1487641) 5 5 - Fix namespaces handling (#1487649) 6 - Add handling of multifolder METADATA/ANNOTATION responses 6 7 7 8 RELEASE 0.5-RC -
program/include/rcube_imap_generic.php
r7f1da48 r814bafc 2807 2807 $this->escape($mailbox), $optlist)); 2808 2808 2809 if ($code == self::ERROR_OK && preg_match('/^\* METADATA /i', $response)) { 2810 // Parse server response (remove "* METADATA ") 2811 $response = substr($response, 11); 2812 $ret_mbox = $this->tokenizeResponse($response, 1); 2813 $data = $this->tokenizeResponse($response); 2809 if ($code == self::ERROR_OK) { 2810 $result = array(); 2811 $data = $this->tokenizeResponse($response); 2814 2812 2815 2813 // The METADATA response can contain multiple entries in a single … … 2817 2815 if (!empty($data) && ($size = count($data))) { 2818 2816 for ($i=0; $i<$size; $i++) { 2819 if (is _array($data[$i])) {2817 if (isset($mbox) && is_array($data[$i])) { 2820 2818 $size_sub = count($data[$i]); 2821 2819 for ($x=0; $x<$size_sub; $x++) { 2822 $ data[$data[$i][$x]] = $data[$i][++$x];2820 $result[$mbox][$data[$i][$x]] = $data[$i][++$x]; 2823 2821 } 2824 2822 unset($data[$i]); 2825 2823 } 2826 else if ($data[$i] == '*' && $data[$i+1] == 'METADATA') { 2827 unset($data[$i]); // "*" 2828 unset($data[++$i]); // "METADATA" 2829 unset($data[++$i]); // Mailbox 2830 } 2831 else { 2832 $data[$data[$i]] = $data[++$i]; 2824 else if ($data[$i] == '*') { 2825 if ($data[$i+1] == 'METADATA') { 2826 $mbox = $data[$i+2]; 2827 unset($data[$i]); // "*" 2828 unset($data[++$i]); // "METADATA" 2829 unset($data[++$i]); // Mailbox 2830 } 2831 // get rid of other untagged responses 2832 else { 2833 unset($mbox); 2834 unset($data[$i]); 2835 } 2836 } 2837 else if (isset($mbox)) { 2838 $result[$mbox][$data[$i]] = $data[++$i]; 2833 2839 unset($data[$i]); 2834 2840 unset($data[$i-1]); 2835 2841 } 2836 } 2837 } 2838 2839 return $data; 2842 else { 2843 unset($data[$i]); 2844 } 2845 } 2846 } 2847 2848 return $result; 2840 2849 } 2841 2850 … … 2941 2950 $this->escape($mailbox), $entries, $attribs)); 2942 2951 2943 if ($code == self::ERROR_OK && preg_match('/^\* ANNOTATION /i', $response)) { 2944 // Parse server response (remove "* ANNOTATION ") 2945 $response = substr($response, 13); 2946 $ret_mbox = $this->tokenizeResponse($response, 1); 2947 $data = $this->tokenizeResponse($response); 2948 $res = array(); 2952 if ($code == self::ERROR_OK) { 2953 $result = array(); 2954 $data = $this->tokenizeResponse($response); 2949 2955 2950 2956 // Here we returns only data compatible with METADATA result format 2951 2957 if (!empty($data) && ($size = count($data))) { 2952 2958 for ($i=0; $i<$size; $i++) { 2953 $entry = $data[$i ++];2954 if (is _array($entry)) {2959 $entry = $data[$i]; 2960 if (isset($mbox) && is_array($entry)) { 2955 2961 $attribs = $entry; 2956 2962 $entry = $last_entry; 2957 2963 } 2958 else 2959 $attribs = $data[$i++]; 2964 else if ($entry == '*') { 2965 if ($data[$i+1] == 'ANNOTATION') { 2966 $mbox = $data[$i+2]; 2967 unset($data[$i]); // "*" 2968 unset($data[++$i]); // "ANNOTATION" 2969 unset($data[++$i]); // Mailbox 2970 } 2971 // get rid of other untagged responses 2972 else { 2973 unset($mbox); 2974 unset($data[$i]); 2975 } 2976 continue; 2977 } 2978 else if (isset($mbox)) { 2979 $attribs = $data[++$i]; 2980 } 2981 else { 2982 unset($data[$i]); 2983 continue; 2984 } 2960 2985 2961 2986 if (!empty($attribs)) { … … 2964 2989 $value = $attribs[$x++]; 2965 2990 if ($attr == 'value.priv') { 2966 $res ['/private' . $entry] = $value;2991 $result[$mbox]['/private' . $entry] = $value; 2967 2992 } 2968 2993 else if ($attr == 'value.shared') { 2969 $res ['/shared' . $entry] = $value;2994 $result[$mbox]['/shared' . $entry] = $value; 2970 2995 } 2971 2996 } 2972 2997 } 2973 2998 $last_entry = $entry; 2974 unset($data[$i-1]); 2975 unset($data[$i-2]); 2976 } 2977 } 2978 2979 return $res; 2999 unset($data[$i]); 3000 } 3001 } 3002 3003 return $result; 2980 3004 } 2981 3005
Note: See TracChangeset
for help on using the changeset viewer.
