Forum OpenACS Q&A: Re: Problem Installing The Jabber Package

Collapse
Posted by martin hebrank on
Why don't you just put a check in the C code to change the SQL for each DB?

I added the extern char * DB_DRIVER, then in tcl_jclient.c:

DB_DRIVER = strdup ( ((cache  = Ns_ConfigGetValue("ns/db/pool/jabber" , "driver"))?cache:"postgres") );

Then, where SQL is used:
if (strcmp(DB_DRIVER,"postgres") == 0) {
    snprintf(query, 4096, "select jb_update_status ('%s' , %s' , '%s' , '%s');", state, jb->resrc, jb->jid , jb->service);
  }
  else {
    snprintf(query, 4096, "begin jb_update_status ('%s' , %s' , '%s' , '%s');  end;", state, jb->resrc, jb->jid , jb->service);
  }

Works for me. . .

Of course, this is all stuff I did because when I first started looking at it I couldn't find any references to the jabber package even being actively developed. . .

** Martin