| 2936 | } |
| 2937 | |
| 2938 | static boolean removeQuotes(Document d, boolean all) { |
| 2939 | Elements quotes = d.body().select(".fairemail_quote"); |
| 2940 | if (!quotes.isEmpty()) { |
| 2941 | quotes.remove(); |
| 2942 | return true; |
| 2943 | } |
| 2944 | |
| 2945 | // Gmail |
| 2946 | quotes = d.body().select(".gmail_quote"); |
| 2947 | if (!quotes.isEmpty()) { |
| 2948 | quotes.remove(); |
| 2949 | return true; |
| 2950 | } |
| 2951 | |
| 2952 | // Outlook: <div id="appendonsend"> |
| 2953 | quotes = d.body().select("div#appendonsend"); |
| 2954 | if (!quotes.isEmpty()) { |
| 2955 | quotes.nextAll().remove(); |
| 2956 | quotes.remove(); |
| 2957 | return true; |
| 2958 | } |
| 2959 | |
| 2960 | // ms-outlook-mobile |
| 2961 | quotes = d.body().select("div#divRplyFwdMsg"); |
| 2962 | if (!quotes.isEmpty()) { |
| 2963 | quotes.nextAll().remove(); |
| 2964 | quotes.remove(); |
| 2965 | return true; |
| 2966 | } |
| 2967 | |
| 2968 | // Microsoft Word 15 |
| 2969 | quotes = d.body().select("div#mail-editor-reference-message-container"); |
| 2970 | if (!quotes.isEmpty()) { |
| 2971 | quotes.remove(); |
| 2972 | return true; |
| 2973 | } |
| 2974 | |
| 2975 | // Web.de: <div id="aqm-original" |
| 2976 | quotes = d.body().select("div#aqm-original"); |
| 2977 | if (!quotes.isEmpty()) { |
| 2978 | quotes.remove(); |
| 2979 | return true; |
| 2980 | } |
| 2981 | |
| 2982 | if (!all) |
| 2983 | return false; |
| 2984 | |
| 2985 | return !d.select("blockquote").remove().isEmpty(); |
| 2986 | } |
| 2987 | |
| 2988 | static String truncate(String text, int at) { |
| 2989 | if (text.length() < at) |