|
|
@ -42,15 +42,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
items:@[
|
|
|
|
items:@[
|
|
|
|
[OWSTableItem itemWithTitle:@"Send 10 messages (1/sec.)"
|
|
|
|
[OWSTableItem itemWithTitle:@"Send 10 messages (1/sec.)"
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[DebugUIMessages sendTextMessage:10 thread:thread];
|
|
|
|
[DebugUIMessages sendTextMessages:10 thread:thread];
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
[OWSTableItem itemWithTitle:@"Send 100 messages (1/sec.)"
|
|
|
|
[OWSTableItem itemWithTitle:@"Send 100 messages (1/sec.)"
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[DebugUIMessages sendTextMessage:100 thread:thread];
|
|
|
|
[DebugUIMessages sendTextMessages:100 thread:thread];
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
[OWSTableItem itemWithTitle:@"Send 1,000 messages (1/sec.)"
|
|
|
|
[OWSTableItem itemWithTitle:@"Send 1,000 messages (1/sec.)"
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
|
[DebugUIMessages sendTextMessage:1000 thread:thread];
|
|
|
|
[DebugUIMessages sendTextMessages:1000 thread:thread];
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
[OWSTableItem itemWithTitle:@"Send text/x-signal-plain"
|
|
|
|
[OWSTableItem itemWithTitle:@"Send text/x-signal-plain"
|
|
|
|
actionBlock:^{
|
|
|
|
actionBlock:^{
|
|
|
@ -146,22 +146,23 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NSArray<NSString *> *randomTexts = @[
|
|
|
|
NSArray<NSString *> *randomTexts = @[
|
|
|
|
@"Lorem ipsum dolor sit amet, consectetur adipiscing elit. ",
|
|
|
|
@"Lorem ipsum dolor sit amet, consectetur adipiscing elit. ",
|
|
|
|
@"Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
|
|
|
|
(@"Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
|
|
|
|
@"Suspendisse rutrum, nulla vitae pretium hendrerit, tellus "
|
|
|
|
@"Suspendisse rutrum, nulla vitae pretium hendrerit, tellus "
|
|
|
|
@"turpis pharetra libero, vitae sodales tortor ante vel sem.",
|
|
|
|
@"turpis pharetra libero, vitae sodales tortor ante vel sem."),
|
|
|
|
@"In a time of universal deceit - telling the truth is a revolutionary act.",
|
|
|
|
@"In a time of universal deceit - telling the truth is a revolutionary act.",
|
|
|
|
@"If you want a vision of the future, imagine a boot stamping on a human face - forever.",
|
|
|
|
@"If you want a vision of the future, imagine a boot stamping on a human face - forever.",
|
|
|
|
@"Who controls the past controls the future. Who controls the present controls the past.",
|
|
|
|
@"Who controls the past controls the future. Who controls the present controls the past.",
|
|
|
|
@"All animals are equal, but some animals are more equal than others.",
|
|
|
|
@"All animals are equal, but some animals are more equal than others.",
|
|
|
|
@"War is peace. Freedom is slavery. Ignorance is strength.",
|
|
|
|
@"War is peace. Freedom is slavery. Ignorance is strength.",
|
|
|
|
@"All the war-propaganda, all the screaming and lies and hatred, comes invariably from people who are not "
|
|
|
|
(@"All the war-propaganda, all the screaming and lies and hatred, comes invariably from people who are not "
|
|
|
|
@"fighting.",
|
|
|
|
@"fighting."),
|
|
|
|
@"Political language. . . is designed to make lies sound truthful and murder respectable, and to give an "
|
|
|
|
(@"Political language. . . is designed to make lies sound truthful and murder respectable, and to give an "
|
|
|
|
@"appearance of solidity to pure wind.",
|
|
|
|
@"appearance of solidity to pure wind."),
|
|
|
|
@"The nationalist not only does not disapprove of atrocities committed by his own side, but he has a "
|
|
|
|
(@"The nationalist not only does not disapprove of atrocities committed by his own side, but he has a "
|
|
|
|
@"remarkable capacity for not even hearing about them.",
|
|
|
|
@"remarkable capacity for not even hearing about them."),
|
|
|
|
@"Every generation imagines itself to be more intelligent than the one that went before it, and wiser than the "
|
|
|
|
(@"Every generation imagines itself to be more intelligent than the one that went before it, and wiser than "
|
|
|
|
@"one that comes after it.",
|
|
|
|
@"the "
|
|
|
|
|
|
|
|
@"one that comes after it."),
|
|
|
|
@"War against a foreign country only happens when the moneyed classes think they are going to profit from it.",
|
|
|
|
@"War against a foreign country only happens when the moneyed classes think they are going to profit from it.",
|
|
|
|
];
|
|
|
|
];
|
|
|
|
NSString *randomText = randomTexts[(NSUInteger)arc4random_uniform((uint32_t)randomTexts.count)];
|
|
|
|
NSString *randomText = randomTexts[(NSUInteger)arc4random_uniform((uint32_t)randomTexts.count)];
|
|
|
@ -170,14 +171,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
[ThreadUtil sendMessageWithText:text inThread:thread messageSender:messageSender];
|
|
|
|
[ThreadUtil sendMessageWithText:text inThread:thread messageSender:messageSender];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ (void)sendTextMessage:(int)counter thread:(TSThread *)thread
|
|
|
|
+ (void)sendTextMessages:(int)counter thread:(TSThread *)thread
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (counter < 1) {
|
|
|
|
if (counter < 1) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[self sendTextMessageInThread:thread counter:counter];
|
|
|
|
[self sendTextMessageInThread:thread counter:counter];
|
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)1.f * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)1.f * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
|
|
|
[self sendTextMessage:counter - 1 thread:thread];
|
|
|
|
[self sendTextMessages:counter - 1 thread:thread];
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|