Exemplo n.º 1
0
int main (int argc, char **argv){
  char *message=NULL;
  char *presence=NULL;
  char *subscription=NULL;
  char *base64=NULL;
  char *clear=NULL;
  char *roster=NULL;
  char *sroster=NULL;
  char *sha=NULL;
  foo = (jabberID*) createJabberID("[email protected]/cjabber");
  if(!foo) return 1;
  printf("foo->user: %s, foo->server: %s, foo->resource: %s, foo->full: %s\n",foo->user,foo->server,foo->resource,foo->full);
  message=createMessage("Hello cruel world!","[email protected]/muh","[email protected]/cjabber",0,"foobar",create_sha_hash("foobarblubb", 11));
  printf("%s",message);
  presence=createPresenceMsg(2,"away from keyboard","[email protected]/input", "[email protected]/bla", 23);
  printf("%s",presence);
  subscription=createSubscriptionMsg(1,NULL,NULL);
  printf("%s",subscription);
  roster=requestRoster("[email protected]/cjabber", "roster_1");
  printf("%s",roster);
  sroster=setRoster("[email protected]/cjabber", "roster_2", "[email protected]/input", "mouse", "device", SUB_SUBSCRIBED);
  printf("%s",sroster);
  base64=encode_base64("This book is just for you in order to give you alternatives, alternatives to nothin' precise. Alternatives are necessary to form yours and other lifes. Alternatives are present everyday, but not overwhelming like you. It's hard to understand why I like you, but as easy as I can say: It's just youl. Will you be my valentine?");
  printf("base64: %s\n",base64);
  clear=decode_base64(base64);
  printf("clear: %s\n",clear);
  sha=create_sha_hash("foobarblubb", 11);
  printf("sha: %s\n",sha);

  return 0;
}
Exemplo n.º 2
0
void SpectrumRosterManager::loadRoster() {
	m_loadingFromDB = true;
	setRoster(Transport::instance()->sql()->getBuddies(m_user->storageId(), m_user->account()));
	m_loadingFromDB = false;
}