/pidgin/main: 7415482377b5: Add TODOs to escape filenames. I do...
Mark Doliner
mark at kingant.net
Mon Feb 18 20:59:20 EST 2013
Changeset: 7415482377b50f61183008f923ca9781e2cfae4c
Author: Mark Doliner <mark at kingant.net>
Date: 2013-02-18 17:59 -0800
Branch: default
URL: http://hg.pidgin.im/pidgin/main/rev/7415482377b5
Description:
Add TODOs to escape filenames. I don't think these are severe problems,
just minor UI bugs.
diffstat:
libpurple/protocols/gg/image.c | 8 ++++++++
libpurple/protocols/sametime/sametime.c | 8 ++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diffs (36 lines):
diff --git a/libpurple/protocols/gg/image.c b/libpurple/protocols/gg/image.c
--- a/libpurple/protocols/gg/image.c
+++ b/libpurple/protocols/gg/image.c
@@ -177,6 +177,14 @@ void ggp_image_recv(PurpleConnection *gc
gchar *imgtag_replace;
GList *pending_messages_it;
+ /* TODO: This PurpleStoredImage will be rendered within the IM window
+ and right-clicking the image will allow the user to save the image
+ to disk. The default filename used in this dialog is the filename
+ that we pass to purple_imgstore_new_with_id(), so we should call
+ g_path_get_basename() and purple_escape_filename() on it before
+ passing it in. This is easy, but it's not clear if there might be
+ other implications because this filename is used elsewhere within
+ this PRPL. */
stored_id = purple_imgstore_new_with_id(
g_memdup(image_reply->image, image_reply->size),
image_reply->size,
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -2780,6 +2780,14 @@ static void im_recv_mime(struct mwConver
cid = make_cid(cid);
/* add image to the purple image store */
+ /* TODO: This PurpleStoredImage will be rendered within the IM window
+ and right-clicking the image will allow the user to save the image
+ to disk. The default filename used in this dialog is the filename
+ that we pass to purple_imgstore_new_with_id(), so we should call
+ g_path_get_basename() and purple_escape_filename() on it before
+ passing it in. This is easy, but it's not clear if there might be
+ other implications because this filename is used elsewhere within
+ this PRPL. */
img = purple_imgstore_new_with_id(d_dat, d_len, cid);
/* map the cid to the image store identifier */
More information about the Commits
mailing list