Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/settings.c @ 1598:a087125d8fc8
Replace libjabber with loudmouth
author | franky |
---|---|
date | Sun, 11 Oct 2009 15:38:32 +0200 |
parents | bff9633e38ee |
children | dcd5d4c75199 |
comparison
equal
deleted
inserted
replaced
1597:4f59a414217e | 1598:a087125d8fc8 |
---|---|
17 * along with this program; if not, write to the Free Software | 17 * along with this program; if not, write to the Free Software |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
19 * USA | 19 * USA |
20 */ | 20 */ |
21 | 21 |
22 #include <strings.h> | 22 #include <stdio.h> |
23 #include <stdlib.h> | 23 #include <stdlib.h> |
24 #include <ctype.h> | 24 #include <string.h> |
25 | 25 |
26 #include "settings.h" | 26 #include "settings.h" |
27 #include "commands.h" | 27 #include "commands.h" |
28 #include "utils.h" | |
29 #include "logprint.h" | 28 #include "logprint.h" |
30 #include "otr.h" | 29 #include "otr.h" |
30 #include "utils.h" | |
31 #include "xmpp.h" | |
31 | 32 |
32 // Maximum line length | 33 // Maximum line length |
33 // (probably best to use the same value as INPUTLINE_LENGTH) | 34 // (probably best to use the same value as INPUTLINE_LENGTH) |
34 #define CONFLINE_LENGTH 1024 | 35 #define CONFLINE_LENGTH 1024 |
35 | 36 |
390 // The caller should free the string after use | 391 // The caller should free the string after use |
391 char *default_muc_nickname(const char *roomid) | 392 char *default_muc_nickname(const char *roomid) |
392 { | 393 { |
393 char *nick; | 394 char *nick; |
394 | 395 |
395 nick = (char*)jb_get_bookmark_nick(roomid); | 396 nick = (char*)xmpp_get_bookmark_nick(roomid); |
396 if (nick) | 397 if (nick) |
397 return g_strdup(nick); | 398 return g_strdup(nick); |
398 | 399 |
399 // We try the "nickname" option, then the username part of the jid. | 400 // We try the "nickname" option, then the username part of the jid. |
400 nick = (char*)settings_opt_get("nickname"); | 401 nick = (char*)settings_opt_get("nickname"); |
535 } | 536 } |
536 | 537 |
537 /* otr settings */ | 538 /* otr settings */ |
538 | 539 |
539 #ifdef HAVE_LIBOTR | 540 #ifdef HAVE_LIBOTR |
540 static void remove_default_policies(char * k, char * policy, void * defaultp) | 541 static void remove_default_policies(char *k, char *policy, void *defaultp) |
541 { | 542 { |
542 if (*(enum otr_policy *)policy == *(enum otr_policy *)defaultp) { | 543 if (*(enum otr_policy *)policy == *(enum otr_policy *)defaultp) { |
543 g_free((enum otr_policy *) policy); | 544 g_free((enum otr_policy *) policy); |
544 g_hash_table_remove(otrpolicy, k); | 545 g_hash_table_remove(otrpolicy, k); |
545 } | 546 } |
576 } | 577 } |
577 | 578 |
578 guint settings_otr_getpolicy(const char *bjid) | 579 guint settings_otr_getpolicy(const char *bjid) |
579 { | 580 { |
580 #ifdef HAVE_LIBOTR | 581 #ifdef HAVE_LIBOTR |
581 enum otr_policy * otrdata; | 582 enum otr_policy *otrdata; |
582 if (!bjid) | 583 if (!bjid) |
583 return default_policy; | 584 return default_policy; |
584 | 585 |
585 otrdata = g_hash_table_lookup(otrpolicy, bjid); | 586 otrdata = g_hash_table_lookup(otrpolicy, bjid); |
586 if (otrdata) | 587 if (otrdata) |