Skip to content

Instantly share code, notes, and snippets.

@prof7bit
Created June 2, 2012 19:29
Show Gist options
  • Save prof7bit/2859681 to your computer and use it in GitHub Desktop.
Save prof7bit/2859681 to your computer and use it in GitHub Desktop.
Why is it popping up the chat window immediately even if I have set it to hide them?
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
);
if not Assigned(conv) then begin
conv := purple_conversation_new(
PURPLE_CONV_TYPE_IM,
purple_account,
PChar(ABuddy.ID)
);
end;
if Assigned(conv) then begin
time := Trunc((Now - EncodeDate(1970, 1 ,1)) * 24 * 60 * 60);
im := purple_conversation_get_im_data(conv);
purple_conv_im_write(
im,
PChar(ABuddy.ID),
PChar(AText),
PURPLE_MESSAGE_RECV,
time
);
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment