Exemplo n.º 1
0
void hon_parse_request(PurpleConnection *gc,gchar* buffer){
    gchar *title = NULL,*msg = NULL;
    guint8 notification_type = read_byte(buffer);
    guint32 unknown = read_guint32(buffer);

    switch (notification_type)
    {
    case HON_NOTIFICATION_ADDED_AS_BUDDY:
        title = g_strdup(_("Friendship Request"));
        msg = g_strdup_printf(_("Sent friendship request to %s"),buffer);
        purple_notify_info(NULL,title,msg,NULL);
        break;
    case HON_NOTIFICATION_BUDDY_ACCEPTED:
        purple_request_input(gc, NULL, _("Friend Request"),
            NULL, buffer, TRUE, FALSE, NULL,
            _("_Accept"), G_CALLBACK(finish_auth_request),
            _("_Ignore"), NULL,
            purple_connection_get_account(gc), buffer, NULL,
            gc);
        break;
    default :
        title = g_strdup_printf(_("Unknown request notification type (%d)"),notification_type);
        msg = g_strdup(buffer);
        purple_notify_info(NULL,title,msg,NULL);
        break;
    }
    g_free(title);
    g_free(msg);
}
Exemplo n.º 2
0
static void add_buddy_question_input(PurpleConnection *gc, guint32 uid, gchar *question)
{
	gchar *who, *msg;
	qq_buddy_req *add_req;
	g_return_if_fail(uid != 0);

	add_req = g_new0(qq_buddy_req, 1);
	add_req->gc = gc;
	add_req->uid = uid;
	add_req->auth = NULL;
	add_req->auth_len = 0;

	who = uid_to_purple_name(uid);
	msg = g_strdup_printf(_("%u requires verification"), uid);
	purple_request_input(gc, _("Add buddy question"), msg,
			_("Enter answer here"),
			NULL,
			TRUE, FALSE, NULL,
			_("Send"), G_CALLBACK(add_buddy_question_cb),
			_("Cancel"), G_CALLBACK(buddy_req_cancel_cb),
			purple_connection_get_account(gc), who, NULL,
			add_req);

	g_free(msg);
	g_free(who);
}
Exemplo n.º 3
0
PurpleRoomlist *jabber_roomlist_get_list(PurpleConnection *gc)
{
	JabberStream *js = gc->proto_data;
	GList *fields = NULL;
	PurpleRoomlistField *f;

	if(js->roomlist)
		purple_roomlist_unref(js->roomlist);

	js->roomlist = purple_roomlist_new(purple_connection_get_account(js->gc));

	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", "room", TRUE);
	fields = g_list_append(fields, f);

	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", "server", TRUE);
	fields = g_list_append(fields, f);

	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, _("Description"), "description", FALSE);
	fields = g_list_append(fields, f);

	purple_roomlist_set_fields(js->roomlist, fields);


	purple_request_input(gc, _("Enter a Conference Server"), _("Enter a Conference Server"),
			_("Select a conference server to query"),
			js->chat_servers ? js->chat_servers->data : NULL,
			FALSE, FALSE, NULL,
			_("Find Rooms"), PURPLE_CALLBACK(roomlist_ok_cb),
			_("Cancel"), PURPLE_CALLBACK(roomlist_cancel_cb),
			purple_connection_get_account(gc), NULL, NULL,			 
			js);

	return js->roomlist;
}
Exemplo n.º 4
0
void add_buddy_authorize_input(PurpleConnection *gc, guint32 uid,
		guint8 *auth, guint8 auth_len)
{
	gchar *who, *msg;
	qq_buddy_req *add_req;
	g_return_if_fail(uid != 0);

	add_req = g_new0(qq_buddy_req, 1);
	add_req->gc = gc;
	add_req->uid = uid;
	add_req->auth = NULL;
	add_req->auth_len = 0;
	if (auth != NULL && auth_len > 0) {
		add_req->auth = g_new0(guint8, auth_len);
		g_memmove(add_req->auth, auth, auth_len);
		add_req->auth_len = auth_len;
	}

	who = uid_to_purple_name(uid);
	msg = g_strdup_printf(_("%u needs authorization"), uid);
	purple_request_input(gc, _("Add buddy authorize"), msg,
			_("Enter request here"),
			_("Would you be my friend?"),
			TRUE, FALSE, NULL,
			_("Send"), G_CALLBACK(add_buddy_auth_cb),
			_("Cancel"), G_CALLBACK(buddy_req_cancel_cb),
			purple_connection_get_account(gc), who, NULL,
			add_req);

	g_free(msg);
	g_free(who);
}
Exemplo n.º 5
0
/*  get a list of qq groups */
PurpleRoomlist *qq_roomlist_get_list(PurpleConnection *gc)
{
    GList *fields;
    qq_data *qd;
    PurpleRoomlist *rl;
    PurpleRoomlistField *f;

    qd = (qq_data *) gc->proto_data;

    fields = NULL;
    rl = purple_roomlist_new(purple_connection_get_account(gc));
    qd->roomlist = rl;

    f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, _("Group ID"), QQ_ROOM_KEY_EXTERNAL_ID, FALSE);
    fields = g_list_append(fields, f);
    f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", QQ_ROOM_KEY_INTERNAL_ID, TRUE);
    fields = g_list_append(fields, f);

    fields = g_list_append(fields, f);
    purple_roomlist_set_fields(rl, fields);
    purple_roomlist_set_in_progress(qd->roomlist, TRUE);

    purple_request_input(gc, _("QQ Qun"),
                         _("Please enter Qun number"),
                         _("You can only search for permanent Qun\n"),
                         NULL, FALSE, FALSE, NULL,
                         _("Search"), G_CALLBACK(_qq_group_search_callback),
                         _("Cancel"), G_CALLBACK(_qq_group_search_cancel_callback),
                         purple_connection_get_account(gc), NULL, NULL,
                         gc);

    return qd->roomlist;
}
Exemplo n.º 6
0
void GeneralMenu::openRequestInputTest(CppConsUI::Button& /*activator*/)
{
  purple_request_input(NULL, "Title", "Primary", "Secondary",
      "default value", FALSE, FALSE, NULL, "Ok",
      G_CALLBACK(input_ok_cb_), "Cancel", NULL, NULL, NULL, NULL,
      this);

  close();
}
Exemplo n.º 7
0
void BuddyList::request_add_group()
{
  if (!CheckAnyAccountConnected())
    return;

  purple_request_input(NULL, _("Add Group"),
      _("Please enter the name of the group to be added."), NULL, NULL, FALSE,
      FALSE, NULL, _("Add"), G_CALLBACK(add_group_ok_cb_), _("Cancel"), NULL,
      NULL, NULL, NULL, this);
}
Exemplo n.º 8
0
static void
pb_oauth_request_access_token(PurpleAccount *account)
{
	purple_notify_uri(account, "https://www.pushbullet.com/authorize?client_id=0m8Tcu8rNSBxeWL65e6nTKmqXqZSIKEe&redirect_uri=https%3A%2F%2Fwww.pushbullet.com%2Flogin-success&response_type=token&scope=everything");
	
	purple_request_input(NULL, NULL, _("Set your Access Token"),
					_("Copy the Success URL you are sent to after you accept"), NULL,
					FALSE, FALSE, "https://www.pushbullet.com/login-success#access_token=...", 
					_("OK"), G_CALLBACK(pb_oauth_set_access_token_cb), 
					_("Cancel"), NULL, account, NULL, NULL, account);
}
Exemplo n.º 9
0
static void
oscar_auth_dontgrant_msgprompt(gpointer cbdata)
{
	struct name_data *data = cbdata;
	purple_request_input(data->gc, NULL, _("Authorization Denied Message:"),
					   NULL, _("No reason given."), TRUE, FALSE, NULL,
					   _("_OK"), G_CALLBACK(oscar_auth_dontgrant),
					   _("_Cancel"), G_CALLBACK(oscar_free_name_data),
					   purple_connection_get_account(data->gc), data->name, NULL,
					   data);
}
Exemplo n.º 10
0
/* we reject other's request of adding me as friend */
static void buddy_add_deny_cb(gpointer data)
{
	qq_buddy_req *add_req = (qq_buddy_req *)data;
	gchar *who = uid_to_purple_name(add_req->uid);
	purple_request_input(add_req->gc, NULL, _("Authorization denied message:"),
			NULL, _("Sorry, you're not my style."), TRUE, FALSE, NULL,
			_("OK"), G_CALLBACK(buddy_add_deny_reason_cb),
			_("Cancel"), G_CALLBACK(buddy_add_deny_noreason_cb),
			purple_connection_get_account(add_req->gc), who, NULL,
			add_req);
	g_free(who);
}
Exemplo n.º 11
0
static void action_sms_myself(PurplePluginAction *action)
{
	PurpleConnection *gc = (PurpleConnection*)action->context;

	g_return_if_fail(NULL != gc && NULL != gc->proto_data);

	purple_request_input(gc, NULL, _("Send SMS to Your Phone"), NULL,
			     NULL, TRUE, FALSE, NULL,
			     _("Send"), G_CALLBACK(send_sms_to_me_cb),
			     _("Close"), NULL,
			     purple_connection_get_account(gc),
			     NULL, NULL, gc);
}
Exemplo n.º 12
0
/*------------------------------------------------------------------------
 * Display the search input form.
 *
 *  @param action	The action object
 */
static void mxit_user_search_action( PurplePluginAction* action )
{
	PurpleConnection*		gc				= (PurpleConnection*) action->context;

	purple_request_input( gc, _( "Search for user" ),
		_( "Search for a MXit contact" ),
		_( "Type search information" ),
		NULL, FALSE, FALSE, NULL,
		_( "_Search" ), G_CALLBACK( mxit_user_search_cb ),
		_( "_Cancel" ), NULL,
		purple_request_cpar_from_connection(gc),
		gc );
}
Exemplo n.º 13
0
static void action_modify_impresa(PurplePluginAction *action)
{
	PurpleConnection *gc = (PurpleConnection*)action->context;

	g_return_if_fail(NULL != gc && NULL != gc->proto_data);

	purple_request_input(gc, NULL, _("Change Signature"), NULL,
			     NULL, FALSE, FALSE, NULL,
			     _("OK"), G_CALLBACK(modify_impresa_cb),
			     _("Cancel"), NULL,
			     purple_connection_get_account(gc),
			     NULL, NULL, gc);
}
Exemplo n.º 14
0
void flist_delete_public_channel_action(PurplePluginAction *action) {
    PurpleConnection *pc = action->context;
    PurpleAccount *pa = purple_connection_get_account(pc);
    FListAccount *fla = pc->proto_data;
    g_return_if_fail(fla);
    if(fla->input_request) return;

    purple_request_input(pc, _("Delete Public Channel"), _("Delete a public channel from the F-List server."),
        _("Please enter the title of the channel to delete."), "",
        FALSE, FALSE, NULL,
        _("OK"), G_CALLBACK(flist_delete_public_channel_cb),
        _("Cancel"), G_CALLBACK(flist_admin_request_cancel_string_cb),
        pa, NULL, NULL, pc); //TODO: give a list of public channels instead!
    fla->input_request = TRUE;
}
Exemplo n.º 15
0
void flist_create_public_channel_action(PurplePluginAction *action) {
    PurpleConnection *pc = action->context;
    PurpleAccount *pa = purple_connection_get_account(pc);
    FListAccount *fla = pc->proto_data;
    g_return_if_fail(fla);
    if(fla->input_request) return;

    purple_request_input(pc, _("Create Public Channel"), _("Create a public channel on the F-List server."),
        _("Please enter a title for your new channel."), "",
        FALSE, FALSE, NULL,
        _("OK"), G_CALLBACK(flist_create_public_channel_cb),
        _("Cancel"), G_CALLBACK(flist_admin_request_cancel_string_cb),
        pa, NULL, NULL, pc);
    fla->input_request = TRUE;
}
Exemplo n.º 16
0
/**
 * They've decided to set a username! Yay!
 */
void msim_set_username_cb(PurpleConnection *gc)
{
    g_return_if_fail(gc != NULL);
    purple_debug_info("msim","Set username\n");
    purple_request_input(gc, _("MySpaceIM - Please Set a Username"),
                         _("Please enter a username to check its availability:"),
                         NULL,
                         "", FALSE, FALSE, NULL,
                         _("OK"), G_CALLBACK(msim_check_username_availability_cb),
                         _("Cancel"), G_CALLBACK(msim_do_not_set_username_cb),
                         purple_connection_get_account(gc),
                         NULL,
                         NULL,
                         gc);
}
Exemplo n.º 17
0
void flist_remove_global_operator_action(PurplePluginAction *action) {
    PurpleConnection *pc = action->context;
    PurpleAccount *pa = purple_connection_get_account(pc);
    FListAccount *fla = pc->proto_data;
    g_return_if_fail(fla);
    if(fla->input_request) return;

    purple_request_input(pc, _("Remove Global Operator"), _("Remove a global operator from the F-List server."),
        _("Please enter the name of the character to demote."), "",
        FALSE, FALSE, NULL,
        _("OK"), G_CALLBACK(flist_remove_global_operator_cb),
        _("Cancel"), G_CALLBACK(flist_admin_request_cancel_string_cb),
        pa, NULL, NULL, pc); //TODO: give a list of global operators instead!
    fla->input_request = TRUE;
}
Exemplo n.º 18
0
void flist_broadcast_action(PurplePluginAction *action) {
    PurpleConnection *pc = action->context;
    PurpleAccount *pa = purple_connection_get_account(pc);
    FListAccount *fla = pc->proto_data;
    g_return_if_fail(fla);
    if(fla->input_request) return;

    purple_request_input(pc, _("Broadcast"), _("Send a broadcast to the entire F-List server."),
        _("Please enter the message you want to broadcast."), "",
        FALSE, FALSE, NULL,
        _("OK"), G_CALLBACK(flist_broadcast_action_cb),
        _("Cancel"), G_CALLBACK(flist_admin_request_cancel_string_cb),
        pa, NULL, NULL, pc);
    fla->input_request = TRUE;
}
Exemplo n.º 19
0
void
skypeweb_search_users(PurplePluginAction *action)
{
	PurpleConnection *pc = (PurpleConnection *) action->context;
	SkypeWebAccount *sa = purple_connection_get_protocol_data(pc);
	
	purple_request_input(pc, "Search for Skype Friends",
					   "Search for Skype Friends",
					   NULL,
					   NULL, FALSE, FALSE, NULL,
					   _("_Search"), G_CALLBACK(skypeweb_search_users_text),
					   _("_Cancel"), NULL,
					   purple_connection_get_account(pc), NULL, NULL,
					   sa);

}
Exemplo n.º 20
0
static void fb_set_status_cb(PurplePluginAction *action)
{
	PurpleConnection *pc = action->context;
	FacebookAccount *fba = pc->proto_data;
	gchar *uid_str;

	uid_str = g_strdup_printf("%" G_GINT64_FORMAT, fba->uid);

	purple_request_input(pc, NULL, _("Set your Facebook status"),
			purple_account_get_alias(pc->account), "is ",
			FALSE, FALSE, NULL, _("OK"),
			G_CALLBACK(fb_set_status_ok_cb), _("Cancel"),
			NULL, pc->account, uid_str, NULL, pc);

	g_free(uid_str);
}
Exemplo n.º 21
0
static void fx_send_sms(PurpleBlistNode *node, gpointer UNUSED(data))
{
	PurpleBuddy *buddy;
	PurpleConnection *gc;

	g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));

	buddy = (PurpleBuddy *) node;
	gc = purple_account_get_connection(buddy->account);

	purple_request_input(gc, NULL, _("Send a mobile message."), NULL,
			     NULL, TRUE, FALSE, NULL,
			     _("Send"), G_CALLBACK(send_sms_cb),
			     _("Cancel"), NULL,
			     purple_connection_get_account(gc),
			     purple_buddy_get_name(buddy), NULL, buddy);
}
Exemplo n.º 22
0
static void rename_cb (GtkWidget *button, GtkTreeSelection *sel)
{
  GtkTreeModel *model;
  GtkTreeIter iter;
  GValue val;
  struct widget *w;
        
  gtk_tree_selection_get_selected (sel, &model, &iter);
  val.g_type = 0;
  gtk_tree_model_get_value (model, &iter, 1, &val);
  w = g_value_get_pointer(&val);
	
  purple_request_input(NULL, 
    _("Rename Widget"), NULL,
    _("Enter a new name for this widget."), w->alias, 
    FALSE, FALSE, NULL,
    _("Rename"), G_CALLBACK(widget_popup_rename_cb),
    _("Cancel"), NULL, NULL, NULL, NULL, w);
}
Exemplo n.º 23
0
void add_buddy_authorize_input( PurpleConnection *gc, qq_buddy_opt_req *opt_req )
{
	gchar *who, *msg;
	g_return_if_fail(opt_req && opt_req->uid != 0 && opt_req->auth && opt_req->auth_len > 0);

	who = uid_to_purple_name(opt_req->uid);
	msg = g_strdup_printf(_("%s needs authorization"), who);
	purple_request_input(gc, _("Add buddy authorize"), msg,
			_("Enter request here"),
			_("Would you be my friend?"),
			TRUE, FALSE, NULL,
			_("Send"), G_CALLBACK(add_buddy_auth_cb),
			_("Cancel"), G_CALLBACK(buddy_req_cancel_cb),
			purple_connection_get_account(gc), who, NULL,
			opt_req);

	g_free(msg);
	g_free(who);
}
Exemplo n.º 24
0
static void do_nick_got_own_nick_cb(JabberStream *js, const char *from, PurpleXmlNode *items) {
	char *oldnickname = NULL;
	PurpleXmlNode *item = NULL;

	if (items)
		item = purple_xmlnode_get_child(items,"item");

	if(item) {
		PurpleXmlNode *nick = purple_xmlnode_get_child_with_namespace(item,"nick","http://jabber.org/protocol/nick");
		if(nick)
			oldnickname = purple_xmlnode_get_data(nick);
	}

	purple_request_input(js->gc, _("Set User Nickname"), _("Please specify a new nickname for you."),
		_("This information is visible to all contacts on your contact list, so choose something appropriate."),
		oldnickname, FALSE, FALSE, NULL, _("Set"), PURPLE_CALLBACK(do_nick_set), _("Cancel"), NULL,
		purple_request_cpar_from_connection(js->gc), js);
	g_free(oldnickname);
}
Exemplo n.º 25
0
Arquivo: buddy.c Projeto: dylex/pidgin
static void
silcpurple_buddy_privkey(PurpleConnection *gc, const char *name)
{
	SilcPurple sg = gc->proto_data;
	char *nickname;
	SilcPurplePrivkey p;
	SilcClientEntry *clients;
	SilcUInt32 clients_count;

	if (!name)
		return;
	if (!silc_parse_userfqdn(name, &nickname, NULL))
		return;

	/* Find client entry */
	clients = silc_client_get_clients_local(sg->client, sg->conn,
						nickname, name,
						&clients_count);
	if (!clients) {
		silc_client_get_clients(sg->client, sg->conn, nickname, NULL,
					silcpurple_buddy_privkey_resolved,
					g_strdup(name));
		silc_free(nickname);
		return;
	}

	p = silc_calloc(1, sizeof(*p));
	if (!p)
		return;
	p->client = sg->client;
	p->conn = sg->conn;
	p->client_id = *clients[0]->id;
	purple_request_input(gc, _("IM With Password"), NULL,
	                     _("Set IM Password"), NULL, FALSE, TRUE, NULL,
	                     _("OK"), G_CALLBACK(silcpurple_buddy_privkey_cb),
	                     _("Cancel"), G_CALLBACK(silcpurple_buddy_privkey_cb),
	                     gc->account, NULL, NULL, p);

	silc_free(clients);
	silc_free(nickname);
}
Exemplo n.º 26
0
static void do_room_join_request(PurpleConnection *gc, qq_room_data *rmd)
{
	gchar *msg;
	qq_room_req *add_req;
	g_return_if_fail(rmd != NULL);

	purple_debug_info("QQ", "Room id %u needs authentication\n", rmd->id);

	msg = g_strdup_printf("QQ Qun %u needs authentication\n", rmd->ext_id);
	add_req = g_new0(qq_room_req, 1);
	add_req->gc = gc;
	add_req->id = rmd->id;
	purple_request_input(gc, _("Join QQ Qun"), msg,
			   _("Input request here"),
			   _("Would you be my friend?"), TRUE, FALSE, NULL,
			   _("Send"),
			   G_CALLBACK(group_join_cb),
			   _("Cancel"), G_CALLBACK(room_join_cancel_cb),
			   purple_connection_get_account(gc), rmd->title_utf8, NULL,
			   add_req);
	g_free(msg);
}
Exemplo n.º 27
0
/**
 * This is where we do a bit more than merely prompt the user.
 * Now we have some real data to tell us the state of their requested username
 * \persistr\\cmd\257\dsn\5\uid\204084363\lid\7\rid\367\body\UserName=TheAlbinoRhino1\final\
 */
static void msim_username_is_available_cb(MsimSession *session, const MsimMessage *userinfo, gpointer data)
{
    MsimMessage *msg;
    gchar *username;
    MsimMessage *body;
    gint userid;

    purple_debug_info("msim_username_is_available_cb", "Look up username callback made\n");

    msg = (MsimMessage *)data;
    g_return_if_fail(MSIM_SESSION_VALID(session));
    g_return_if_fail(msg != NULL);

    username = msim_msg_get_string(msg, "user");
    body = msim_msg_get_dictionary(userinfo, "body");

    if (!body) {
        purple_debug_info("msim_username_is_available_cb", "No body for %s?!\n", username);
        purple_connection_error_reason(session->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
                                       "An error occurred while trying to set the username.\n"
                                       "Please try again, or visit http://editprofile.myspace.com/index.cfm?"
                                       "fuseaction=profile.username to set your username.");
        return;
    }

    userid = msim_msg_get_integer(body, "UserID");

    purple_debug_info("msim_username_is_available_cb", "Returned username is %s and userid is %d\n", username, userid);
    msim_msg_free(body);
    msim_msg_free(msg);

    /* The response for a free username will ONLY have the UserName in it..
     * thus making UserID return 0 when we msg_get_integer it */
    if (userid == 0) {
        /* This username is currently unused */
        purple_debug_info("msim_username_is_available_cb", "Username available. Prompting to Confirm.\n");
        msim_username_to_set = g_strdup(username);
        g_free(username);
        purple_request_yes_no(session->gc,
                              _("MySpaceIM - Username Available"),
                              _("This username is available. Would you like to set it?"),
                              _("ONCE SET, THIS CANNOT BE CHANGED!"),
                              0,
                              session->account,
                              NULL,
                              NULL,
                              session->gc,
                              G_CALLBACK(msim_set_username_confirmed_cb),
                              G_CALLBACK(msim_do_not_set_username_cb));
    } else {
        /* Looks like its in use or we have an invalid response */
        purple_debug_info("msim_username_is_available_cb", "Username unavaiable. Prompting for new entry.\n");
        purple_request_input(session->gc, _("MySpaceIM - Please Set a Username"),
                             _("This username is unavailable."),
                             _("Please try another username:"******"", FALSE, FALSE, NULL,
                             _("OK"), G_CALLBACK(msim_check_username_availability_cb),
                             _("Cancel"), G_CALLBACK(msim_do_not_set_username_cb),
                             session->account,
                             NULL,
                             NULL,
                             session->gc);
    }
}