libpurple/protocols/gg/gg.h

Wed, 17 Mar 2021 04:13:27 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Wed, 17 Mar 2021 04:13:27 -0500
changeset 40819
54b2a95ac176
parent 40439
e9838d634d5e
child 40865
82e45cd837fa
permissions
-rw-r--r--

Cleanup deprecated libsoup usage

* Use `soup_session_add_feature_by_type` instead of the option.
* Use strings instead of defines for libsoup properties.
The former are deprecated and removed from libsoup 3.

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/574/

/**
 * @file gg.h
 *
 * purple
 *
 * Copyright (C) 2005  Bartosz Oler <bartosz@bzimage.us>
 *
 * 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  02111-1301  USA
 */

#ifndef PURPLE_GG_GG_H
#define PURPLE_GG_GG_H

#define GGP_UIN_LEN_MAX 10

#include <gmodule.h>
#include <libgadu.h>
#include <libsoup/soup.h>

#include "search.h"

#include <purple.h>

#include "image-prpl.h"
#include "avatar.h"
#include "roster.h"
#include "multilogon.h"
#include "status.h"
#include "chat.h"
#include "message-prpl.h"
#include "edisc.h"

#define GGP_TYPE_PROTOCOL             (ggp_protocol_get_type())
#define GGP_PROTOCOL(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), GGP_TYPE_PROTOCOL, GGPProtocol))
#define GGP_PROTOCOL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), GGP_TYPE_PROTOCOL, GGPProtocolClass))
#define GGP_IS_PROTOCOL(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), GGP_TYPE_PROTOCOL))
#define GGP_IS_PROTOCOL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), GGP_TYPE_PROTOCOL))
#define GGP_PROTOCOL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), GGP_TYPE_PROTOCOL, GGPProtocolClass))

typedef struct
{
	PurpleProtocol parent;
} GGPProtocol;

typedef struct
{
	PurpleProtocolClass parent_class;
} GGPProtocolClass;

typedef struct {
	struct gg_session *session;
	SoupSession *http;
	guint inpa;

	gchar *imtoken;
	gboolean imtoken_warned;

	ggp_image_session_data *image_data;
	ggp_avatar_session_data *avatar_data;
	ggp_roster_session_data roster_data;
	ggp_multilogon_session_data *multilogon_data;
	ggp_status_session_data *status_data;
	ggp_chat_session_data *chat_data;
	ggp_message_session_data *message_data;
	ggp_edisc_session_data *edisc_data;
} GGPInfo;

typedef struct
{
	gboolean blocked;
	gboolean not_a_friend;
} ggp_buddy_data;

G_MODULE_EXPORT GType ggp_protocol_get_type(void);

ggp_buddy_data * ggp_buddy_get_data(PurpleBuddy *buddy);

const gchar * ggp_get_imtoken(PurpleConnection *gc);

uin_t ggp_own_uin(PurpleConnection *gc);

void ggp_async_login_handler(gpointer _gc, gint fd, PurpleInputCondition cond);

#endif /* PURPLE_GG_GG_H */

mercurial