API idea for extended status

24 views
Skip to first unread message

Lastwebpage

unread,
Jun 26, 2009, 2:57:29 PM6/26/09
to Miranda IM Develop
Hello,
I want write an addon like this one http://addons.miranda-im.org/details.php?action=viewfile&id=3626
because it's a little bit time-consuming to set the normal status text
and 6 texts for this extended status.
I read somewhere something about that there are plans for a general
API for this extended status, but nothing happened, for this reason I
make this post now, maybe as an idea.

Okay let's start with the needed things.
- Possibility to set the texts. The "old" ICQ have two texts, jabber
and the new ICQ only one. Maybe only one text is needed, but what
happens with ICQ7.5 or MSN 10.0? Who knows? I think it's a good idea
to make it possible to set two texts, even if the protocol only
support one alterable text.
- Amount of extended status, ICQ have one, jabber two, maybe the next
Yahoo protocol 3? Who knows? This should be variable. For e.g.
services like SetActivity and SetMood in jabber and SetXStatus in ICQ
is not the best way, maybe Yahoo named the 3 status "feelings", what
now? A service SetFeelings in the yahoo protocol?
- Possibility to share the icons. An developer can copy&paste the
icons in the own addon resources, but this is horrible. It should be
possible for a addon to reuse the icons from the protocol.
- Possibility to share the status. For e.g. jabber have 60 moods.
copy&paste the text in the own addon, it's horrible too.
- Get the current state. It should be possible to read out all this
extended status stuff from a protocol, read out the values from the DB
is maybe not the best idea.
-Possibility to call the default dialog for an extended status. The
dialog that opens when the user select an extended status within the
protocol.

Based on this deliberations:

GetCustomStatusAmount
wParam=lParam=0;
return=amount of CustomStatus
e.g. ICQ=1, Jabber=2, this is the index number for some following
services

GetCustomStatusDescription
wParam=N=index number from GetCustomStatusAmount
lParam=(TCHAR*)pszDescription;
return=0 on success or nonzero otherwise
e.g. ICQ="XStatus", Jabber="Mood","Activity"

GetCustomStatusIconList
wParam=N=index number from GetCustomStatusAmount
lParam=0
return=HIMAGELIST

GetCustomStatusIcon
wParam=N=index number from GetCustomStatusAmount
lParam=iconID
return=HICON

GetCustomStatusTextArray
wParam=N=index number from GetCustomStatusAmount
lParam=0
return= a pointer to an array of structs CUSTOM_STATUS
szFirst= category or entry, szSecond=entry (or NULL id protocol have
no categories for this),
szTitle=either szFirst or szSecond,iconID =index in the Icon imagelist
e.g. look in the jabber protocol jabber line 799 g_arrActivities,
jabber_Status.cpp and ICQ line 211 m_icq ICQ_CUSTOM_STATUS,
I am not completely sure about the structure from above, but I think
you know what I mean, it should return a list of all custom status
text and ONE struct like ICQ_CUSTOM_STATUS would be nice too to use it
for all custom status handling in all protocols.
===============================================
SetOwnCustomStatus
wParam=N=index number from GetCustomStatusAmount
lParam=pointer to this mysterious CUSTOM_STATUS struct
return=0 on success or nonzero otherwise
This service set the custom status direct

CallOwnCustomStatus
wParam=N=index number from GetCustomStatusAmount
lParam=pointer to this mysterious CUSTOM_STATUS struct
return=0 on success or nonzero otherwise
This service call the dialog from the protocol to set the custom
status (like a click on the ICQ Xstatus or a Jabber mood)
===============================================
GetContactCustomStatus
wParam=N=index number from GetCustomStatusAmount
lParam=hContact, or NULL for the own custom status
return=pointer to this mysterious CUSTOM_STATUS struct
===============================================

I know many things are injudicious, not finish, wrong and maybe some
things are missing,
this are only some ideas from me to merge the custom status handling
for ICQ and Jabber, and make the things a little bit independent from
a specific protocol.

Peter
Reply all
Reply to author
Forward
0 new messages