TS3 SDK - Stop message from sending?

Johnny1987

Member
Joined
Apr 21, 2016
Messages
6
Reaction score
0
Points
33
Hello,

I wanted to ask if there is any function that I can use to stop client from sending current message?
I'd like to make auto text format thing which will automatically eg. make the text bold or change its color.

I mean I want it to like this: Client sends a message -> plugin stops the message from sending and saves it to variable -> the message is prepared to its bold -> send the message using requestSendPrivateTextMsg
 

0x0539

Retired Staff
Contributor
Joined
Jan 30, 2016
Messages
1,334
Reaction score
1,146
Points
254
So you want every received message in bold/color?

If this is what you want, you might as well use a skin, not the bold part but there are definitely color changes in them.
 

Johnny1987

Member
Joined
Apr 21, 2016
Messages
6
Reaction score
0
Points
33
So you want every received message in bold/color?

If this is what you want, you might as well use a skin, not the bold part but there are definitely color changes in them.

Not received, I want to make my messages bold and I don't want it to send 2 messages like:
I wrote this msg
I wrote this msg
because i managed to do something like that, but that doesnt satisfy me.
 

Derp

Retired Staff
Contributor
Joined
Apr 30, 2015
Messages
933
Reaction score
1,014
Points
217
Could you post your code please?
 

Johnny1987

Member
Joined
Apr 21, 2016
Messages
6
Reaction score
0
Points
33
Code:
int ts3plugin_onTextMessageEvent(uint64 serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored) {

    anyID clid;
    ts3Functions.getClientID(serverConnectionHandlerID, &clid);
    if(clid == fromID)
    {
    char msg[256];
    uint64 channelid;

    snprintf(msg, sizeof(msg), u8"[b]%s[/b]", message);

    ts3Functions.getChannelOfClient(serverConnectionHandlerID, clid, &channelid);
    ts3Functions.requestSendChannelTextMsg(serverConnectionHandlerID, msg, channelid, NULL);
    }
    return 0;
}
 
Last edited:

Derp

Retired Staff
Contributor
Joined
Apr 30, 2015
Messages
933
Reaction score
1,014
Points
217
change
Code:
return 0;
to
Code:
return 1;

-Derp
 

Johnny1987

Member
Joined
Apr 21, 2016
Messages
6
Reaction score
0
Points
33
change
Code:
return 0;
to
Code:
return 1;

-Derp

But still people see that previous message which I really dont want to be happening

I want the plugin to totally stop the first message and then send only the second one (the formatted one)
 
Last edited:
Top