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 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
{ 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.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
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
{ This function is not what it seems to be. It will NOT simply be called | |
with the filename already known (as one might assume when looking | |
at its signature) instead it will be called with filename=nil when | |
the user clicks on the "Send File..." menu item. At this time there | |
has not yet been a file dialog to select the file, this will happen | |
when we call purple_xfer_request(). All the rest is then done from | |
within the callbacks that we are registering here. } | |
procedure torchat_send_file(gc: PPurpleConnection; who, filename: PChar); cdecl; | |
var | |
xfer: PPurpleXfer; |
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
/** | |
* Starts a file transfer. | |
* | |
* Either @a fd must be specified <i>or</i> @a ip and @a port on a | |
* file receive transfer. On send, @a fd must be specified, and | |
* @a ip and @a port are ignored. | |
* | |
* Prior to libpurple 2.6.0, passing '0' to @a fd was special-cased to | |
* allow the protocol plugin to facilitate the file transfer itself. As of | |
* 2.6.0, this is supported (for backward compatibility), but will be |
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.OnProxyConnect(ASocket: TLSocket); | |
type | |
TSocksReqestHeader = packed record | |
Typ : Byte; | |
Cmd : Byte; | |
Port : Word; | |
Addr4 : DWord; | |
end; | |
var | |
ReqHeader: TSocksReqestHeader; |
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
/.project |
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
""" | |
a simple stop loss bot. | |
adjust STOP_PRICE and STOP_VOLUME to your needs. | |
The file can be reloaded after editing without | |
restarting goxtool by simply pressing the l key. | |
""" | |
import strategy | |
import goxapi | |
# pylint: disable=C0301 |
OlderNewer