Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 237
Registered: ‎05-21-2012
My Device: BlackBerry RED Z10
My Carrier: WiFi

PROBLEM onMessageUpdated() Check BBM Message if Read or Sent?

Hi, I have already tried all I can but still no luck on how I can determine if the bbm message caught by onMessageUpdated() if it's already read or sent or draft. Only sms and emails does give info if they're already read, sent or draft. Please see attached code.

 

void ApplicationUI::onMessageUpdated(bb::pim::account::AccountKey accountId, bb::pim::message::ConversationKey conversationId, bb::pim::message::MessageKey messageId, bb::pim::message::MessageUpdate data)
{
	Message message = m_messageService->message(accountId, messageId);
	Conversation conversation = m_messageService->conversation(accountId, conversationId);
	MessageUpdate xdata = data;

	if(xdata.contains(MessageUpdate::None))
	{
		qDebug() << "XXXX --- None"; // bbm message doesn't get here
	}
	else if(xdata.contains(MessageUpdate::Read))
	{
		qDebug() << "XXXX --- Read"; // bbm message doesn't get here
	}
	else if(xdata.contains(MessageUpdate::StatusChanged))
	{
		qDebug() << "XXXX --- StatusChanged"; // bbm message doesn't get here
	}

	if(
			!message.isSent() &&
			!message.isDraft() &&
			message.status() != MessageStatus::Draft &&
			message.status() != MessageStatus::Read &&
			(message.transmissionStatus() != MessageTransmissionStatus::Sent ||
			message.transmissionStatus() != MessageTransmissionStatus::FailedToSent)
	)
	{
		qDebug() << "BBM MESSAGE CATCHED!!! NOT SENT, NOT DRAFT and NOT READ";  // bbm message doesn't get here
	}
}

 I hope there's a solution to this. Please. 

Developer
Posts: 33
Registered: ‎12-05-2013
My Device: Z10
My Carrier: 123456789

Re: PROBLEM onMessageUpdated() Check BBM Message if Read or Sent?

We can't. If you check the message.isValid() it says message is invalid. No idea when or will they allow us to do so. Smiley Sad
Developer
Posts: 237
Registered: ‎05-21-2012
My Device: BlackBerry RED Z10
My Carrier: WiFi

Re: PROBLEM onMessageUpdated() Check BBM Message if Read or Sent?

Really sad. Any BlackBerry Employee to answer please?

Highlighted
Developer
Posts: 61
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone

Re: PROBLEM onMessageUpdated() Check BBM Message if Read or Sent?

For messages comming to the inbox i have :

 

bb:Smiley Tongueim::message::Message message = _messageService->message(accountID, messageID);
if (message.mimeType() == MimeTypes:Smiley Frustratedms && message.isInbound()

{

  /* message is incoming, deal with it. */

}

 

The message.isInbound() tells me the message is incoming.

But i do not know if it works for BBM messages.