ptonev.com

Products and Projects => Phantom User Miranda Protocol => : donatas April 28, 2005, 07:11:57 PM



: Sources
: donatas April 28, 2005, 07:11:57 PM
Is there Any chance to get sources of this plugin? For private usage (just to look how it's done)
thanks.
_______
donatas (developer of nConvers++)


: Sources
: ptonev April 29, 2005, 01:21:36 PM
Hi, donatas.
Is there Any chance to get sources of this plugin? For private usage (just to look how it's done)

No chance, but if You ask I will be answer on yours questions.

Best regards


: Sources
: donatas May 06, 2005, 04:35:32 PM
: "ptonev"
Hi, donatas.
Is there Any chance to get sources of this plugin? For private usage (just to look how it's done)

No chance, but if You ask I will be answer on yours questions.

Best regards

ok :)
so:
as i saw your plugin made via delphi - right?
1: how register plugin as "protocol"(so miranda show's it in protocols) ?
2: i kno how to add "contact" to db, but how send this contact online? (away/NA/etc...)
that's all (for now) :) thanks!


: Sources
: ptonev May 09, 2005, 08:48:57 PM
Hi,
1: how register plugin as "protocol"(so miranda show's it in protocols) ?

:
 ZeroMemory(@pd, SizeOf(pd));
  pd.cbSize:= SizeOf(TPROTOCOLDESCRIPTOR);
  pd.szName:= MPHANTOMUSER_MODULE_NAME;
  pd.type_:= PROTOTYPE_PROTOCOL;

  CallService(MS_PROTO_REGISTERMODULE, 0, lParam(@pd));

That I registred plugin as Protocol plugin. Next I hook on various events.

2: i kno how to add "contact" to db, but how send this contact online? (away/NA/etc...)

:
function OnSetStatus(wParam: WPARAM; lParam: LPARAM): int; cdecl;
var
  i, Count  :LongInt;
  hContact  :THandle;
  OldStatus :Int;
begin

  OldStatus:= Status;
  Status:= wParam;

  case Status of
    ID_STATUS_OFFLINE    :Status:= ID_STATUS_OFFLINE;
    ID_STATUS_ONLINE     :Status:= ID_STATUS_ONLINE;
    ID_STATUS_AWAY       :Status:= ID_STATUS_ONLINE;
    ID_STATUS_DND        :Status:= ID_STATUS_ONLINE;
    ID_STATUS_NA         :Status:= ID_STATUS_ONLINE;
    ID_STATUS_OCCUPIED   :Status:= ID_STATUS_ONLINE;
    ID_STATUS_FREECHAT   :Status:= ID_STATUS_ONLINE;
    ID_STATUS_INVISIBLE  :Status:= ID_STATUS_ONLINE;
    ID_STATUS_ONTHEPHONE :Status:= ID_STATUS_ONLINE;
    ID_STATUS_OUTTOLUNCH :Status:= ID_STATUS_ONLINE;
  else
    Status:= ID_STATUS_OFFLINE;
  end;

  ProtoBroadcastAck(MPHANTOMUSER_MODULE_NAME, 0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, OldStatus, status);

  Count:= PluginLink.CallService(MS_DB_CONTACT_GETCOUNT, 0, 0);
  hContact:= PluginLink.CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);

  for i:= 1 to Count do
  begin

    if IsPhantomUser(hContact) then
    begin

      DBWriteContactSettingDWord(hContact, MPHANTOMUSER_MODULE_NAME, 'Status', StatusPerContactType(Status, hContact));

    end;

    hContact:= PluginLink.CallService(MS_DB_CONTACT_FINDNEXT, Dword(HContact), 0);

  end;

  Result:= 0;

end;


That I set user on-line.

Best regards,


: Sources
: donatas May 10, 2005, 04:56:26 PM
big thanks ;)


: Sources
: ptonev May 11, 2005, 01:12:26 PM
If you have other question ask freely.  :D

best reagrds,


Sorry, the copyright must be in the template.
Please notify this forum's administrator that this site is missing the copyright message for SMF so they can rectify the situation. Display of copyright is a legal requirement. For more information on this please visit the Simple Machines website.