本文整理汇总了C++中ThreadData::lastMessageSubject方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadData::lastMessageSubject方法的具体用法?C++ ThreadData::lastMessageSubject怎么用?C++ ThreadData::lastMessageSubject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadData
的用法示例。
在下文中一共展示了ThreadData::lastMessageSubject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EmptyString
/*static*/
void
SmsManager::NotifyThreadCursorResult(int64_t aId,
jni::String::Param aLastMessageSubject,
jni::String::Param aBody,
int64_t aUnreadCount,
jni::ObjectArray::Param aParticipants,
int64_t aTimestamp,
jni::String::Param aLastMessageType,
int32_t aRequestId)
{
ThreadData thread;
thread.id() = aId;
thread.lastMessageSubject() = aLastMessageSubject ?
aLastMessageSubject->ToString() :
EmptyString();
thread.body() = aBody ? aBody->ToString() : EmptyString();
thread.unreadCount() = aUnreadCount;
thread.timestamp() = aTimestamp;
thread.lastMessageType() = eMessageType_SMS;
JNIEnv* const env = jni::GetEnvForThread();
jobjectArray participants = aParticipants.Get();
jsize length = env->GetArrayLength(participants);
for (jsize i = 0; i < length; ++i) {
jstring participant =
static_cast<jstring>(env->GetObjectArrayElement(participants, i));
if (participant) {
thread.participants().AppendElement(nsJNIString(participant, env));
}
}
nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction([=]() {
nsCOMPtr<nsIMobileMessageCursorCallback> request =
AndroidBridge::Bridge()->GetSmsCursorRequest(aRequestId);
if (!request) {
return;
}
nsCOMArray<nsIMobileMessageThread> arr;
arr.AppendElement(new MobileMessageThreadInternal(thread));
nsIMobileMessageThread** elements;
int32_t size;
size = arr.Forget(&elements);
request->NotifyCursorResult(reinterpret_cast<nsISupports**>(elements),
size);
});
NS_DispatchToMainThread(runnable);
}