Forked from jonathan-wheeler/gist:0f8235f5904365e3c75a
Last active
September 19, 2015 21:26
Star
You must be signed in to star a gist
Fix for WhatsApp in iOS 8 Beta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Taken zigmob's (http://forums.macrumors.com/showthread.php?t=1742566) workaround a step further | |
And added some triggers to clean up these dodgy character combinations (ff, fi, fl). | |
Still crashes on initial message read but saves having to manually run the sql query eve time a message contains the character combinations */ | |
-- Working well for me so far -- | |
/* | |
Kane Lai 2014-07-13 | |
Improved by updating only the affected row in the trigger. | |
Also, supplied the restore script too. | |
*/ | |
/* workaround fix */ | |
update ZWAMESSAGE set ZTEXT = replace( ZTEXT, 'ff', '[f f]') where ZWAMESSAGE.ZTEXT like '%ff%'; | |
update ZWAMESSAGE set ZTEXT = replace( ZTEXT, 'fi', '[f i]') where ZWAMESSAGE.ZTEXT like '%fi%'; | |
update ZWAMESSAGE set ZTEXT = replace( ZTEXT, 'fl', '[f l]') where ZWAMESSAGE.ZTEXT like '%fl%'; | |
DROP TRIGGER ios8_fix; | |
CREATE TRIGGER ios8_fix AFTER INSERT ON ZWAMESSAGE FOR EACH ROW | |
BEGIN | |
UPDATE ZWAMESSAGE SET ZTEXT = replace(ZTEXT, 'ff', '[f f]') WHERE ROWID = NEW.ROWID; | |
UPDATE ZWAMESSAGE SET ZTEXT = replace(ZTEXT, 'fi', '[f i]') WHERE ROWID = NEW.ROWID; | |
UPDATE ZWAMESSAGE SET ZTEXT = replace(ZTEXT, 'fl', '[f l]') WHERE ROWID = NEW.ROWID; | |
END; | |
/* fallback */ | |
update ZWAMESSAGE set ZTEXT = replace(ZTEXT, '[f f]', 'ff') where ZWAMESSAGE.ZTEXT like '%[f f]%'; | |
update ZWAMESSAGE set ZTEXT = replace(ZTEXT, '[f i]', 'fi') where ZWAMESSAGE.ZTEXT like '%[f i]%'; | |
update ZWAMESSAGE set ZTEXT = replace(ZTEXT, '[f l]', 'fl') where ZWAMESSAGE.ZTEXT like '%[f l]%'; | |
DROP TRIGGER ios8_fix; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment