how to update my changed picture in my buddy - WeOnlyDo Discussion board

how to update my changed picture in my buddy (General questions)

by sapna, Monday, July 06, 2009, 08:17 (5618 days ago)

hi...

when i change my display picture locally how do i make my buddies see the new picture? also, pictures of my buddies who are on gtalk cannot be retrieved. only pictures of buddies on gmail chat can be retrieved. why so?

thanks,
sapna

Re: how to update my changed picture in my buddy

by woddrazen, Monday, July 06, 2009, 09:56 (5618 days ago) @ sapna

Hi Sapna,


When you change your picture your buddies should see new picture automatically.

I open wodXMPP with my first gmail account and open Google Talk with my second gmail acoount.

Then I change picture in Google Talk and try to receive it in wodXMPP using other gmail account and it works.

Are you using latest version of wodXMPP and Google Talk?


Regards,
Drazen

Re: how to update my changed picture in my buddy

by sapna, Monday, July 06, 2009, 10:56 (5618 days ago) @ woddrazen

hi

for some reasong i am not receiving it. also when i say [code]
IXMPPVCard mycard ;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE) ;
mycard.Receive() ;
mycard.DetachDispatch() ;
[/code]
the LPDISPATCH contact that i am receiving in the xmpp_vcarddetails returns NULL
why so?

thanks,
sapna

Re: how to update my changed picture in my buddy

by woddrazen, Monday, July 06, 2009, 11:56 (5618 days ago) @ sapna

Sapna,


Which version of wodXMPP you are using? You can check version using wodXMPP Version Property.

Can you also please try something like this[code] IXMPPContacts cnts;
cnts.AttachDispatch(m_XMPP.GetContacts(), TRUE);
VARIANT var;
var.vt = VT_I2;
var.iVal = 0;

IXMPPContact cnt;
cnt.AttachDispatch(cnts.GetItem(var), TRUE);

IXMPPVCard vcard;
vcard.AttachDispatch(cnt.GetVCard(), TRUE);
vcard.Receive();[/code]
this code will receive first contact VCard.


Drazen

Re: how to update my changed picture in my buddy

by sapna, Monday, July 06, 2009, 13:38 (5618 days ago) @ woddrazen

hi..

this is the code i am using to retrieve my buddy's vcards. but the code
[code]
IXMPPVCard mycard ;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE) ;
mycard.Receive() ;
mycard.DetachDispatch() ;
[/code]

this is to retrieve my own vcard. is there any other method how i can retrieve my own picture from the server?
also this code is returning a null contact in the xmpp_vcarddetails. is there anyway i can view my own vcard?

thanks,
sapna

Re: how to update my changed picture in my buddy

by sapna, Monday, July 06, 2009, 15:44 (5618 days ago) @ sapna

i am using version 1.3.4. the update isn't working

Re: how to update my changed picture in my buddy

by woddrazen, Monday, July 06, 2009, 16:02 (5618 days ago) @ sapna

Sapna,


You should add your ID when you want to request own VCard.

For receiving own or your buddies picture you should call XMPPVCard object Photo Property
http://www.weonlydo.com/XMPP/Help/WODXMPPLib~XMPPVCard~Photo.html


Drazen

Re: how to update my changed picture in my buddy

by sapna, Monday, July 06, 2009, 16:29 (5618 days ago) @ woddrazen

hi.. i am using the same syntax as given in the help you mentioned. what id are you talking about that should be sent to the server to retreive my own vcard?

Re: how to update my changed picture in my buddy

by wodDamir, Monday, July 06, 2009, 17:08 (5618 days ago) @ sapna

Sapna,

Can you please provide me whole version number? (If I remember right, we made some changes regarding retrieving own VCard in past)

I've just tried with our 1.3.4.145, and the same code works like a charm.

Also, in order to update your picture, you need to call VCard.Send method first. Otherwise you don't actually perform the update.

Regards,
Damba

Re: how to update my changed picture in my buddy

by sapna, Monday, July 06, 2009, 17:18 (5618 days ago) @ wodDamir

hi..

if the vcard contains a picture i get my own vcard. else what happens is when i retrieve my own vcard if there is no picture then the xmpp_vcarddetails function returns a null in the contact field. why does this happen?

thanks,
sapna

Re: how to update my changed picture in my buddy

by wodDamir, Monday, July 06, 2009, 18:36 (5618 days ago) @ sapna

Sapna,

I just tried this, but the code:

[code] mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE) ;
mycard.Receive() ;
mycard.DetachDispatch();[/code]

Works like a charm. I get Contact normally in VCardDetails event regardless if wether there is a Photo assigned to Contact or not.

Can you show me the code you use in VCardDetails?

Regards,
Damba

Re: how to update my changed picture in my buddy

by sapna, Tuesday, July 07, 2009, 07:45 (5618 days ago) @ wodDamir

[code]
IXMPPVCard mycard ;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE) ;
mycard.Receive() ;
mycard.DetachDispatch() ;
[/code]
this is the code i have used. the contact that i am recieving is null

Re: how to update my changed picture in my buddy

by wodDamir, Tuesday, July 07, 2009, 10:39 (5617 days ago) @ sapna

Sapna,

Sorry, I don't know how I ended replying to your other question related to the same issue.

However, can you add debugging into PreTranslateReply and PreTranslateCommand events, to dump Command and Reply parameters into a file?

Then request (receive) your VCard, and post what exactly is returned from server.

Also, can you please re-import the component? If I'm correct, Kreso made a workaround to provide JID on GMail, although it doesn't really send XMPPID tag.

Regards,
Damba

Re: how to update my changed picture in my buddy

by wodDamir, Tuesday, July 07, 2009, 13:43 (5617 days ago) @ wodDamir

Sapna,

Can you please update to the latest version (published 15 min ago)?

I believe we made some changes related to this issue. You *should* now receive null for Contact (if you request your own VCard).

Can you please try it out?

Regards,
Damba

Re: how to update my changed picture in my buddy

by sapna, Tuesday, July 07, 2009, 13:59 (5617 days ago) @ wodDamir

yes i received a null for contact when i request for my own vcard. also i have purchased the license. the test version dialog box is now popping up that i have updated the version with the one you just sent.

Re: how to update my changed picture in my buddy

by wodDamir, Tuesday, July 07, 2009, 14:38 (5617 days ago) @ sapna

Sapna,

In order for the popup to go away, you need to set LicenseKey property to the one received by e-mail.

As for the null, you should no longer use the Contact parameter in VCardDetails, but check JID directly from wodXMPP.VCard.

Regards,
Damba

Re: how to update my changed picture in my buddy

by sapna, Tuesday, July 07, 2009, 15:02 (5617 days ago) @ wodDamir

Sapna,

In order for the popup to go away, you need to set LicenseKey property to the one received by e-mail.

As for the null, you should no longer use the Contact parameter in VCardDetails, but check JID directly from wodXMPP.VCard.

Regards,
Damba

i am using vc++. so how do i use the wodxmpp.vcard directly? i need not only my jid buy also the nick name i have set for myself and also my picture. how do i retrieve all this without using the contacta parameter?

Re: how to update my changed picture in my buddy

by sapna, Tuesday, July 07, 2009, 15:05 (5617 days ago) @ sapna

also,

when i receive a xmpp_vcard notification without receiving the contact how would i know who's vcard i am receiving as i have to attach dispatch to the contact details that i am receiving, if it is null how do i continue?

Re: how to update my changed picture in my buddy

by sapna, Tuesday, July 07, 2009, 15:08 (5617 days ago) @ sapna

i have said setlicensekey and it worked earlier. now that you updated the version file the pop up is appearing again

Re: how to update my changed picture in my buddy

by wodDamir, Tuesday, July 07, 2009, 15:25 (5617 days ago) @ sapna

Sapna,

The following code accesses your VCard:

[code]IXMPPVCard mycard;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE);
AfxMessageBox(mycard.GetJid());[/code]

While this code:

[code] IXMPPContact cnt;
cnt.AttachDispatch(Contact, TRUE);

IXMPPVCard vcard;
vcard.AttachDispatch(cnt.GetVCard(), TRUE);
vcard.Receive();[/code]

Is accessing VCard of a Contact.

I'm not really expert in c++, but can't you check if object is null or not?

Something like this (in VCardDetails):

[code] if(Contact)
{
IXMPPContact cnt;
cnt.AttachDispatch(Contact, TRUE);

IXMPPVCard vcard;
vcard.AttachDispatch(cnt.GetVCard(), TRUE);
vcard.Receive();
}
else
{
IXMPPVCard mycard;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE);
AfxMessageBox(mycard.GetJid());
}[/code]

Can you try that? If that doesn't help, I'll ask our programmers for a code sample, but imo something like that should work.

As for the LicenseKey. Did you set the property? Does it exist? If property doesn't exist, then you most probably downloaded Demo, or you didn't re-import the component into VC.

Regards,
Damba

Re: how to update my changed picture in my buddy

by sapna, Tuesday, July 07, 2009, 15:33 (5617 days ago) @ wodDamir

Sapna,

The following code accesses your VCard:

[code]IXMPPVCard mycard;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE);
AfxMessageBox(mycard.GetJid());[/code]

this code is to get my own vcard from the server. this is not where the problem is. when the server returns the vcard for myself it returns contact details of xmpp_vcarddetails as null. so i cannot get my own vcard if i haven't set a picture already. if i have set a picture then the contact details returned from the server is not null.

While this code:

[code] IXMPPContact cnt;
cnt.AttachDispatch(Contact, TRUE);

IXMPPVCard vcard;
vcard.AttachDispatch(cnt.GetVCard(), TRUE);
vcard.Receive();[/code]

Is accessing VCard of a Contact.

I'm not really expert in c++, but can't you check if object is null or not?

// this is for all my contacts in my buddy list. here i am receiving all the vcards properly

Something like this (in VCardDetails):

[code] if(Contact)
{
IXMPPContact cnt;
cnt.AttachDispatch(Contact, TRUE);

IXMPPVCard vcard;
vcard.AttachDispatch(cnt.GetVCard(), TRUE);
vcard.Receive();
}
else
{
IXMPPVCard mycard;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE);
AfxMessageBox(mycard.GetJid());
}[/code]

//here i not only need my own jid but also my own nickname that i have set earlier.
Can you try that? If that doesn't help, I'll ask our programmers for a code sample, but imo something like that should work.

As for the LicenseKey. Did you set the property? Does it exist? If property doesn't exist, then you most probably downloaded Demo, or you didn't re-import the component into VC.

Regards,
Damba

Re: how to update my changed picture in my buddy

by wodDamir, Tuesday, July 07, 2009, 15:58 (5617 days ago) @ sapna

Sapna,

[code]IXMPPVCard mycard;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE);
AfxMessageBox(mycard.GetJid());[/code]

Doesn't trigger VCardDetails at all. VCardDetails is only triggered when Receive is called. In that case, it's *normal* that you get Contact as NULL, since you requested your own VCard (you aren't your own contact).

As for accessing other properties (NickName, Name, etc...), you simply use mycard.GetNickName, mycard.GetFirstName etc...

You can see list of all the properties available for VCard object here: http://www.weonlydo.com/XMPP/Help/WODXMPPLib~XMPPVCard.html

Regards,
Damba

Re: how to update my changed picture in my buddy

by sapna, Tuesday, July 07, 2009, 16:34 (5617 days ago) @ wodDamir

[code]
IXMPPVCard mycard ;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE) ;
CString nickName = mycard.GetNickName() ;
//this is returning NULL
CPictureHolder *myPicture = new CPictureHolder;
HBITMAP hBMP ;
IDispatch * pTempDispatch = mycard.GetPhoto() ;
// this is returning NULL too
if(pTempDispatch != NULL)
{
myPicture->SetPictureDispatch((LPPICTUREDISP)mycard.GetPhoto());
myPicture->m_pPict->get_Handle((OLE_HANDLE FAR *)&hBMP) ;
m_pIMDialog->SetImage(hBMP) ;
}
else
{
m_pIMDialog->SetImage( userpic.bmp ) ;
}

mycard.DetachDispatch() ;
[/code]
the NULL is being returned for my own vcard when i already have a picture. if i have a picture then in contact details of xmpp_vcarddetails i will receive my own vcard. which means that i will receive my own contact card if i say mycard.receive()

Re: how to update my changed picture in my buddy

by sapna, Tuesday, July 07, 2009, 16:38 (5617 days ago) @ sapna

Sapna,

[code]IXMPPVCard mycard;
mycard.AttachDispatch(m_XMPP.GetVCard(), TRUE);
AfxMessageBox(mycard.GetJid());
//this line of code too returns null. nothing is there in the GetJid();
[/code]

Doesn't trigger VCardDetails at all. VCardDetails is only triggered when Receive is called. In that case, it's *normal* that you get Contact as NULL, since you requested your own VCard (you aren't your own contact).

As for accessing other properties (NickName, Name, etc...), you simply use mycard.GetNickName, mycard.GetFirstName etc...

You can see list of all the properties available for VCard object here: http://www.weonlydo.com/XMPP/Help/WODXMPPLib~XMPPVCard.html

Regards,
Damba

Re: how to update my changed picture in my buddy

by wodDamir, Wednesday, July 08, 2009, 08:42 (5616 days ago) @ sapna

Sapna,

Since we aren't able to reproduce this on our side, most probably the issue is related to some part of your code.

Can you please send us an application that demonstrates this? Can you modify our sample to perform as your application does and send it to techsupport@weonlydo.com ?

Regards,
Damba

Re: how to update my changed picture in my buddy

by sapna, Thursday, July 09, 2009, 09:35 (5615 days ago) @ wodDamir

is there a size limit for a picture i upload in the vcard setphoto function? because i am trying to change my picture in my application and the picture change gets reflected only for a few pictures and not all

Re: how to update my changed picture in my buddy

by woddrazen, Thursday, July 09, 2009, 10:15 (5615 days ago) @ sapna

Sapna,


Can we maybe duplicate this? Can you give us some example?

What is size and resolution of image?


Drazen

Re: how to update my changed picture in my buddy

by sapna, Thursday, July 09, 2009, 10:22 (5615 days ago) @ woddrazen

i used the code that you gave me earlier. maximum resolution of the image is 117x116 or 116x117. and we are using 24 bit bitmaps. it does not work for pictures bigger that this.

Re: how to update my changed picture in my buddy

by woddrazen, Thursday, July 09, 2009, 13:08 (5615 days ago) @ sapna

Sapna,


This works for me.

Here is picture I use for test:
http://www.bossgtcentral.com/pics/bossgt6b.bmp

Can you give us maybe some example picture that will not work?


Drazen

Re: how to update my changed picture in my buddy

by sapna, Thursday, July 09, 2009, 14:35 (5615 days ago) @ woddrazen

hi

this is the code i used to update my picture

[code]
CPictureHolder *myPicture = new CPictureHolder ;
HBITMAP hBMP ;
myPicture->CreateFromBitmap(m_pIMDialog->m_imgWndObject.GetBitmap()) ;
IDispatch * pTempDispatch = (IDispatch *)myPicture->GetPictureDispatch() ;
m_MyVcard.AttachDispatch(m_XMPP.GetVCard(),TRUE) ;
m_MyVcard.SetPhoto(pTempDispatch) ;
m_MyVcard.Send() ;
m_MyVcard.Receive() ;
m_MyVcard.DetachDispatch() ;[/code]

and i used the same picture that you sent in the link and its not getting sent

Re: how to update my changed picture in my buddy

by sapna, Thursday, July 09, 2009, 14:45 (5615 days ago) @ sapna

i am also getting disconnected if the picture size is too big. with error code 10060

Re: how to update my changed picture in my buddy

by sapna, Thursday, July 09, 2009, 14:49 (5615 days ago) @ sapna

sorry the error code is 0 with errortext as No Error in xmpp_disconnected

Re: how to update my changed picture in my buddy

by woddrazen, Thursday, July 09, 2009, 15:27 (5615 days ago) @ sapna

Sapna,


Maybe this is server limitation in size of image you can upload. Can you maybe that same with some other XMPP client maybe?

Let us know how it goes.


Drazen

Re: how to update my changed picture in my buddy

by sapna, Thursday, July 09, 2009, 16:11 (5615 days ago) @ woddrazen

i have logged into the jabber client using a gmail account. it is not uploading the picture of a size bigger than specified earlier