Created attachment 2182 [details] patch to allow mailto along with other args Hello! This patch allows mailto: links to be used with other args instead of having to be a standalone arg. Thanks!
Ho Avinash, Don't get what you wan't to achieve here. What's the point of passing two mailto: links, for example?
Ricardo, I chatted with Avinash on IRC... The patch allows, for example, adding --alternate-config-dir [DIR] when using a mailto link or command line. This was the itch which is scratched. However, I think the problem lies in being able to launch another c-m when --alternate-config-dir is used. You'll have two instances when you start with --alternate-config-dir and then without. Prohibiting a duplicate launch fails in this case. If that was fixed, then this patch is unnecessary.
(In reply to Paul from comment #2) The issue which this patch solves has nothing to do with multiple instances. Let's say there will be only one instance. Now I want this to be that instance: `claws-mail mailto:a@b.com --alternate-config-dir [DIR]`. I can't do that with current implementation as current implementation only accepts mailto:a@b.com if it's only one argument (`-d` is exception as it's removed from argv) Why this is needed? Web browsers expose setting to set mailto: link handler which comes in handy as user simply clicks on any mailto link on the webpage and the mail client opens. Claws-mail can't do that as present if user have config dir in some custom location as mailto: is being accepted if argc == 2. This patch frees mailto: from that restriction and allows it to be combined with other command line options.
Also `p && *p != '\0'` is unnecessary as if we are in `if ()` then we know it's going to be true. So I dropped that redundant check. Then I also removed `p` - unnecessary ternary variable.
Created attachment 2196 [details] Updated patch I just noticed redundant check and unnecessary ternary variable down the code. This patch includes above fix + removes the redundant code.
Created attachment 2197 [details] Final patch Oops! Forgot to attach latest changes. Sorry! Now this should be fixed. :)