[Pidgin] #13465: Patch for using mood messages with ICQ
Pidgin
trac at pidgin.im
Fri Mar 25 12:18:13 EDT 2011
#13465: Patch for using mood messages with ICQ
-------------------------------------------+--------------------------------
Reporter: dustin | Owner: ivan.komarov
Type: patch | Status: new
Milestone: 2.8.0 | Component: ICQ
Version: 2.7.10 | Resolution:
Keywords: x-status mood comment message |
-------------------------------------------+--------------------------------
Comment(by dustin):
Replying to [comment:5 rekkanoryo]:
> I'm not sure I like the `purple_str_truncate_at_pos()` function in this
patch, but I could be convinced to apply the patch regardless.
[..]
You are right.
I've made a public function of this because i've seen the code elsewhere
and didn't want to repeat it.
OTOH I didn't want to change unrelated parts of the code, so the code
duplication is still there.
After all, the code may not be as useful as I thought:
1. Apparently, there are only 2 spots with similar code (not 3 or 4 as I
thought), so it might not be worth a public function.
2. More importantly, the code from my patch is just not safe at all.
It's not taken into account that the string "..." is actually 4
characters.
That's not a problem in {{{family_icbm.c}}} and {{{oscar.c}}} from where
I copied it (there are only protocol and display limits, not a buffer
limit), but it would be a problem in a general function.
I have now modified the patch, so the truncation is done inline without a
separate function.
The second patch contains {{{purple_str_truncate_at_pos()}}}.
I've changed the spots with this code fragment to use this function
instead of doing the truncation inline.
(The patch is not necessarily meant to be applied in this form, it's
rather a list where {{{purple_str_truncate_at_pos()}}} might be of use.)
--
Ticket URL: <http://developer.pidgin.im/ticket/13465#comment:6>
Pidgin <http://pidgin.im>
Pidgin
More information about the Tracker
mailing list