Subversion Repositories SmartDukaan

Rev

Rev 37388 | Rev 37413 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37388 Rev 37409
Line 1... Line 1...
1
package com.spice.profitmandi.service.whatsapp;
1
package com.spice.profitmandi.service.whatsapp;
2
 
2
 
3
/**
3
/**
4
 * Recipient-number handling shared by the WhatsApp providers.
4
 * Recipient-number handling for the WhatsApp gateway.
5
 *
5
 *
6
 * <p>Lives here rather than in a general string utility because "prefix 91" is an India-MSISDN rule
6
 * <p>Lives here rather than in a general string utility because "prefix 91" is an India-MSISDN rule
7
 * that only holds for this integration.</p>
7
 * that only holds for this integration.</p>
8
 */
8
 */
9
public final class WhatsappNumbers {
9
public final class WhatsappNumbers {
Line 28... Line 28...
28
            return "91" + digits;
28
            return "91" + digits;
29
        }
29
        }
30
        return digits;
30
        return digits;
31
    }
31
    }
32
 
32
 
33
    /**
-
 
34
     * The legacy Gupshup admission check: the raw string must be exactly ten characters, with no
-
 
35
     * cleanup first. Deliberately stricter than {@link #toMsisdn} — Gupshup has been dropping numbers
-
 
36
     * that fail this for years, and loosening it during a refactor would start delivering a backlog of
-
 
37
     * messages that were never meant to go out in one burst. Only Gupshup should use this.
-
 
38
     */
-
 
39
    public static boolean isTenDigit(String mobile) {
-
 
40
        return mobile != null && mobile.length() == 10;
-
 
41
    }
-
 
42
}
33
}