ptonev.com
November 24, 2017, 09:35:27 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Sources  (Read 6845 times)
donatas
Guest
« on: 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++)
Logged
ptonev
Administrator
Newbie
*****
Posts: 135


3119712
View Profile WWW
« Reply #1 on: April 29, 2005, 01:21:36 pm »

Hi, donatas.
Quote
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
Logged
donatas
Guest
« Reply #2 on: May 06, 2005, 04:35:32 pm »

Quote from: "ptonev"
Hi, donatas.
Quote
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!
Logged
ptonev
Administrator
Newbie
*****
Posts: 135


3119712
View Profile WWW
« Reply #3 on: May 09, 2005, 08:48:57 pm »

Hi,
Quote
1: how register plugin as "protocol"(so miranda show's it in protocols) ?

Code:
 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.

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

Code:
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,
Logged
donatas
Guest
« Reply #4 on: May 10, 2005, 04:56:26 pm »

big thanks ;)
Logged
ptonev
Administrator
Newbie
*****
Posts: 135


3119712
View Profile WWW
« Reply #5 on: May 11, 2005, 01:12:26 pm »

If you have other question ask freely.  :D

best reagrds,
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!