Mercurial > pidgin-twitter
diff pidgin-twitter.c @ 28:73e817be3267 0.5.1
- Fixed a crash bug. Each unload/reload cycle caused crash due to unrefed regp.
- Revised README.
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Mon, 05 May 2008 23:32:20 +0900 |
parents | 1b784171b08a |
children | e740ceed9337 |
line wrap: on
line diff
--- a/pidgin-twitter.c Mon May 05 21:00:11 2008 +0900 +++ b/pidgin-twitter.c Mon May 05 23:32:20 2008 +0900 @@ -247,6 +247,16 @@ purple_signal_connect(purple_conversations_get_handle(), "sending-im-msg", plugin, PURPLE_CALLBACK(sending_im_cb), NULL); + /* compile regex */ + regp[RECIPIENT] = g_regex_new("@([A-Za-z0-9_]+)", 0, 0, NULL); + regp[SENDER] = g_regex_new("<body>([A-Za-z0-9_]+): ", 0, 0, NULL); + regp[COMMAND] = g_regex_new( + "^(?:\\s*)([dDfFgGlLmMnNtTwW]{1}\\s+[A-Za-z0-9_]+\\Z)", + G_REGEX_RAW, 0, NULL); + regp[PSEUDO] = g_regex_new( + "^\\s*(?:[\"#$%&'()*+,\\-./:;<=>?\\[\\\\\\]_`{|}~]|[^\\s\\x21-\\x7E])*([dDfFgGlLmMnNtTwW]{1})(?:\\Z|\\s+|[^\\x21-\\x7E]+\\Z)", + G_REGEX_RAW, 0, NULL); + return TRUE; } @@ -372,7 +382,7 @@ PURPLE_PRIORITY_DEFAULT, /**< priority */ PIDGINTWITTER_PLUGIN_ID, /**< id */ "Pidgin-Twitter", /**< name */ - "0.5.0", /**< version */ + "0.5.1", /**< version */ "replaces @username to a link and play sound", /** summary */ "replaces @username in a link and play sound", /** desc */ "Yoshiki Yazawa (yaz@honeyplanet.jp)", /**< author */ @@ -403,18 +413,6 @@ purple_prefs_add_string(OPT_USERLIST_RECIPIENT, DEFAULT_LIST); purple_prefs_add_int(OPT_SOUNDID_SENDER, PURPLE_SOUND_POUNCE_DEFAULT); purple_prefs_add_string(OPT_USERLIST_SENDER, DEFAULT_LIST); - - /* compile regex */ - regp[RECIPIENT] = g_regex_new("@([A-Za-z0-9_]+)", 0, 0, NULL); - regp[SENDER] = g_regex_new("<body>([A-Za-z0-9_]+): ", 0, 0, NULL); - - regp[COMMAND] = g_regex_new( - "^(?:\\s*)([dDfFgGlLmMnNtTwW]{1}\\s+[A-Za-z0-9_]+\\Z)", - G_REGEX_RAW, 0, NULL); - - regp[PSEUDO] = g_regex_new( - "^\\s*(?:[\"#$%&'()*+,\\-./:;<=>?\\[\\\\\\]_`{|}~]|[^\\s\\x21-\\x7E])*([dDfFgGlLmMnNtTwW]{1})(?:\\Z|\\s+|[^\\x21-\\x7E]+\\Z)", - G_REGEX_RAW, 0, NULL); } PURPLE_INIT_PLUGIN(pidgin_twitter, init_plugin, info)