This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TBuddy.InitiateConnect; | |
begin | |
WriteLn('TBuddy.InitiateConnect() ' + ID); | |
with FLnetClient do begin | |
OnConnect := @Self.OnProxyConnect; | |
OnReceive := @Self.OnProxyReceive; | |
OnDisconnect := @Self.OnProxyDisconect; | |
OnError := @Self.OnProxyError; | |
end; | |
FLnetClient.Connect(Client.TorHost, Client.TorPort); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TTorChatPurpleClient.OnInstantMessage(ABuddy: IBuddy; AText: String); | |
var | |
conv: PPurpleConversation; | |
im: PPurpleConvIm; | |
time: time_t; | |
begin | |
conv :=purple_find_conversation_with_account( | |
PURPLE_CONV_TYPE_IM, | |
PChar(ABuddy.ID), | |
purple_account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ WinSock2 patch for larger TFDSet (1024 instead of 64). | |
These types and functions are identical with the ones from WinSock2, the | |
only difference is the value of FD_SETSIZE and therefore a larger TFDSet | |
array. Putting this unit *after* the winsock2 unit into your uses clause | |
will make these new definitions take precedence. | |
} | |
unit lws2override; | |
{$mode objfpc}{$H+} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TTorChatPurpleClient.OnBuddyStatusChange(ABuddy: TABuddy); | |
var | |
buddy: PPurpleBuddy; | |
presence : PPurplePresence; | |
status_id: PChar; | |
begin | |
WriteLn('TTorChatPurpleClient.OnBuddyStatusChange()'); | |
buddy := purple_find_buddy(purple_account, PChar(ABuddy.ID)); | |
if Assigned(buddy) then begin | |
case ABuddy.Status of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure OnLogin(Account: PPurpleAccount); cdecl; | |
var | |
Client: TTorChatPurpleClient; | |
Status: PPurpleStatus; | |
TorChatBuddy: TABuddy; | |
PurpleBuddy: PPurpleBuddy; | |
TorchatList: TABuddyList; | |
PurpleList: PGSList; | |
ID : String; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure CRC16_Update(var CRC: Word; Data: Byte); | |
var | |
I: Integer; | |
begin | |
CRC := CRC xor (Word(Data)); | |
for I := 0 to 7 do begin | |
if (CRC and 1) <> 0 then | |
CRC := (CRC shr 1) xor $A001 | |
else | |
CRC := CRC shr 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure CRC16_Xmodem_Update(var CRC: Word; Data: Byte); | |
var | |
I: Integer; | |
begin | |
CRC := CRC xor (Word(Data) shl 8); | |
for I := 0 to 7 do begin | |
if (CRC and $8000) <> 0 then | |
CRC := (CRC shl 1) xor $1021 | |
else | |
CRC := CRC shl 1; |
NewerOlder