add buddy to the buddy list

Kamanashis Roy Shuva kamanashisroy at gmail.com
Sun Aug 5 05:08:36 EDT 2007


Hi,

  Thank you very much for answering.

  I do not want to see the buddy or allow him in my server program. There is
a callback assigned to the signal of new buddy request that calls the
following function(which allows everyone). And also the same function is
used to add new buddy from the database or some other external program.

   I have seen the blist.xml file that has the buddies I added earlier.

   The problem is in the remote end. I mean the remote buddy that I want to
add does
get a request or invitation prompt and therefore cannot add me. And the
total thing
causes that the message does not reach to the remote end.

   Now there is some confusion. Sometime the remote user gets invitation
that I am requesting him in my buddy list. But it is not
always. It happens mostly when it is MSN and Yahoo. The wired thing is to
test this case I always have to create
a new account to add. For a hint, AOL , ICQ and XMPP never gets the request.


   I have seen the code that
the protocol specific callback function is called when I add
a buddy. But it does not realy add a buddy.

   Another clue, I enabled debug . And it showed a log of things on startup
and after a
timely basis. But the interesting thing is that there is no debug
immediately after adding
the buddy(may be because that is scheduled for afterword, I do not know). If
felt that it is
not sending any request to the server so that the server inform the remote
end.


  Again, Is the following enough for adding buddy ?


static void add_newone(PurpleAccount *account, const char *username, const
char *group, const char *alias) {
PurpleGroup *grp;
PurpleBuddy *buddy;

/* see if the buddy is already there */
if(purple_find_buddy( account, username)) {
return;
}
grp = purple_find_group(group);
if (!grp) {
/* creating a new group */
grp = purple_group_new(group);
purple_blist_add_group(grp, NULL);
}
buddy = purple_buddy_new(account, username, alias);
purple_blist_add_buddy(buddy, NULL, grp, NULL);
purple_account_add_buddy(account, buddy);
ECHOC("added buddy %s in account
%s\n",username,purple_account_get_username(account));
}

   I am attaching the simple code so that you can compile and test.

-- Thanks again
Kamanashis Roy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20070805/9c9ec59b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nullclient.tgz
Type: application/x-gzip
Size: 16263 bytes
Desc: not available
URL: <http://pidgin.im/pipermail/devel/attachments/20070805/9c9ec59b/attachment-0002.bin>


More information about the Devel mailing list