Determining the Mode (new message, reply, forward, etc) of the Compose Window?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Determining the Mode (new message, reply, forward, etc) of the Compose Window?

whitedavidp
My addon is listening to the compose window's "compose-window-init"
events. In these listener functions, how can I best determine if the
window is created as the result of new message, reply to, forward, edit
as new, etc? Looking at the window title text seems lame and would vary
by locale. I am sure there is a better way to do this but I have no idea
what that might be. Thanks.
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Determining the Mode (new message, reply, forward, etc) of the Compose Window?

whitedavidp
[hidden email] wrote:
> My addon is listening to the compose window's "compose-window-init"
> events. In these listener functions, how can I best determine if the
> window is created as the result of new message, reply to, forward, edit
> as new, etc? Looking at the window title text seems lame and would vary
> by locale. I am sure there is a better way to do this but I have no idea
> what that might be. Thanks.

I just stumbled into this and it appears to work in TB 2.x. Does this
remain in later versions?

gMsgCompose.type == Components.interfaces.nsIMsgCompType.New
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Determining the Mode (new message, reply, forward, etc) of the Compose Window?

Neil-4
[hidden email] wrote:

> [hidden email] wrote:
>
>> My addon is listening to the compose window's "compose-window-init"
>> events. In these listener functions, how can I best determine if the
>> window is created as the result of new message, reply to, forward,
>> edit as new, etc? Looking at the window title text seems lame and
>> would vary by locale. I am sure there is a better way to do this but
>> I have no idea what that might be. Thanks.
>
> I just stumbled into this and it appears to work in TB 2.x. Does this
> remain in later versions?
>
> gMsgCompose.type == Components.interfaces.nsIMsgCompType.New

I believe that is still a reasonable approach, however, assuming it
matters, I seem to remember that there is a way of switching between
"Reply" and "Reply All", and I don't know offhand whether that gets
updated in that case.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird