< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] Retrieving the body in a Message


Try:

Contents    *body = message.getContents();

Data bodyData = body->getBodyData();
const char  *str = bodyData.c_str();

 

This will keep the Data object in scope while you access str.

 

Or

 

Data bodyData = Data::from(*body);

 

 

Scott

 

From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxxx [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxxx] On Behalf Of Ali Pey
Sent: Tuesday, November 21, 2006 5:02 PM
To: resiprocate-devel@xxxxxxxxxxxxxxxxxxxx
Subject: [reSIProcate] Retrieving the body in a Message

 

Hi All,

I have problem retrieving the text in the body of a Message (The actual Message message for IM).

I use the following code:

Contents    *body = message.getContents();
const char  *str = body->getBodyData().c_str();

This works if the text in the body is less than 16 characters and doesn't work for longer texts.

Am I doing anything wrong?
Is there a bug in Resiprocate?
Is there a better way to retrieve the text in the body?

Thanks,
Ali