/***************************************************************************\ * * * BitlBee - An IRC to IM gateway * * Jabber module - Main file * * * * Copyright 2006-2013 Wilmer van der Gaast * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * \***************************************************************************/ #ifndef _JABBER_H #define _JABBER_H #include #include "bitlbee.h" #include "md5.h" #include "xmltree.h" extern GSList *jabber_connections; typedef enum { JFLAG_STREAM_STARTED = 1, /* Set when we detected the beginning of the stream and want to do auth. */ JFLAG_AUTHENTICATED = 2, /* Set when we're successfully authenticatd. */ JFLAG_STREAM_RESTART = 4, /* Set when we want to restart the stream (after SASL or TLS). */ JFLAG_WANT_SESSION = 8, /* Set if the server wants a tag before we continue. */ JFLAG_WANT_BIND = 16, /* ... for tag. */ JFLAG_WANT_TYPING = 32, /* Set if we ever sent a typing notification, this activates all XEP-85 related code. */ JFLAG_XMLCONSOLE = 64, /* If the user added an xmlconsole buddy. */ JFLAG_STARTTLS_DONE = 128, /* If a plaintext session was converted to TLS. */ JFLAG_GTALK = 0x100000, /* Is Google Talk, as confirmed by iq discovery */ JFLAG_SASL_FB = 0x10000, /* Trying Facebook authentication. */ } jabber_flags_t; typedef enum { JBFLAG_PROBED_XEP85 = 1, /* Set this when we sent our probe packet to make sure it gets sent only once. */ JBFLAG_DOES_XEP85 = 2, /* Set this when the resource seems to support XEP85 (typing notification shite). */ JBFLAG_IS_CHATROOM = 4, /* It's convenient to use this JID thingy for groupchat state info too. */ JBFLAG_IS_ANONYMOUS = 8, /* For anonymous chatrooms, when we don't have have a real JID. */ JBFLAG_HIDE_SUBJECT = 16, /* Hide the subject field since we probably showed it already. */ } jabber_buddy_flags_t; /* Stores a streamhost's (a.k.a. proxy) data */ typedef struct { char *jid; char *host; char port[6]; } jabber_streamhost_t; typedef enum { JCFLAG_MESSAGE_SENT = 1, /* Set this after sending the first message, so we can detect echoes/backlogs. */ } jabber_chat_flags_t; struct jabber_data { struct im_connection *ic; int fd; void *ssl; char *txq; int tx_len; int r_inpa, w_inpa; struct xt_parser *xt; jabber_flags_t flags; char *username; /* USERNAME@server */ char *server; /* username@SERVER -=> server/domain, not hostname */ char *me; /* bare jid */ const struct oauth2_service *oauth2_service; char *oauth2_access_token; /* After changing one of these two (or the priority setting), call presence_send_update() to inform the server about the changes. */ const struct jabber_away_state *away_state; char *away_message; md5_state_t cached_id_prefix; GHashTable *node_cache; GHashTable *buddies; GSList *filetransfers; GSList *streamhosts; int have_streamhosts; }; struct jabber_away_state { char code[5]; char *full_name; }; typedef xt_status (*jabber_cache_event) ( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ); struct jabber_cache_entry { time_t saved_at; struct xt_node *node; jabber_cache_event func; }; /* Somewhat messy data structure: We have a ha
/*
 * libyahoo2: yahoo_httplib.h
 *
 * Copyright (C) 2002-2004, Philip S Tellis <philip.tellis AT gmx.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#ifndef YAHOO_HTTPLIB_H
#define YAHOO_HTTPLIB_H

#ifdef __cplusplus
extern "C" {
#endif

#include "yahoo2_types.h"

char *yahoo_urlencode(const char *instr);
char *yahoo_urldecode(const char *instr);
char *yahoo_xmldecode(const char *instr);

int yahoo_tcp_readline(char *ptr, int maxlen, int fd);
void yahoo_http_post(int id, const char *url, const char *cookies, long size,
		yahoo_get_fd_callback callback, void *data);
void yahoo_http_get(int id, const char *url, const char *cookies,
		yahoo_get_fd_callback callback, void *da