rest//.c -> cpp

master
Tony Olagbaiye 2 years ago
parent 665457ad56
commit 2482fd4691
No known key found for this signature in database
GPG Key ID: 9E2FF3BDEBDFC910

1
.gitignore vendored

@ -40,6 +40,7 @@ cscope*
*.i*86
*.x86_64
*.hex
**/run
# Debug files
*.dSYM/

@ -14,13 +14,13 @@
#include "plugin.hh"
#include "xmpp/stanza.hh"
#include "config.hh"
#include "input.h"
#include "input.hh"
#include "omemo.hh"
#include "account.hh"
#include "connection.hh"
#include "user.hh"
#include "channel.hh"
#include "buffer.h"
#include "buffer.hh"
struct t_account *accounts = NULL;
struct t_account *last_account = NULL;

@ -10,7 +10,7 @@
#include "plugin.hh"
#include "account.hh"
#include "channel.hh"
#include "buffer.h"
#include "buffer.hh"
void buffer__get_account_and_channel(struct t_gui_buffer *buffer,
struct t_account **account,
@ -145,7 +145,7 @@ int buffer__close_cb(const void *pointer, void *data,
(void) pointer;
(void) data;
buffer_plugin = weechat_buffer_get_pointer(buffer, "plugin");
buffer_plugin = (struct t_weechat_plugin*)weechat_buffer_get_pointer(buffer, "plugin");
if (buffer_plugin != weechat_plugin)
return WEECHAT_RC_OK;
buffer__get_account_and_channel(buffer, &ptr_account, &ptr_channel);

@ -2,8 +2,7 @@
// License, version 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef _WEECHAT_XMPP_BUFFER_H_
#define _WEECHAT_XMPP_BUFFER_H_
#pragma once
void buffer__get_account_and_channel(struct t_gui_buffer *buffer,
struct t_account **account,
@ -22,5 +21,3 @@ int buffer__nickcmp_cb(const void *pointer, void *data,
int buffer__close_cb(const void *pointer, void *data,
struct t_gui_buffer *buffer);
#endif /*WEECHAT_XMPP_BUFFER_H*/

@ -15,8 +15,8 @@
#include "omemo.hh"
#include "user.hh"
#include "channel.hh"
#include "input.h"
#include "buffer.h"
#include "input.hh"
#include "buffer.hh"
#include "pgp.hh"
#include "util.hh"

@ -14,8 +14,8 @@
#include "account.hh"
#include "user.hh"
#include "channel.hh"
#include "buffer.h"
#include "message.h"
#include "buffer.hh"
#include "message.hh"
#include "command.hh"
#define MAM_DEFAULT_DAYS 2

@ -14,8 +14,8 @@
#include "account.hh"
#include "channel.hh"
#include "user.hh"
#include "buffer.h"
#include "completion.h"
#include "buffer.hh"
#include "completion.hh"
void completion__channel_nicks_add_speakers(struct t_gui_completion *completion,
struct t_account *account,
@ -146,7 +146,7 @@ void completion__init()
size_t length = snprintf(NULL, 0, "%s|%s",
default_template,
"%(account)") + 1;
char *new_template = malloc(length);
char *new_template = (char*)malloc(length);
snprintf(new_template, length, "%s|%s",
default_template,
"%(account)");

@ -2,9 +2,6 @@
// License, version 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef _WEECHAT_XMPP_COMPLETION_H_
#define _WEECHAT_XMPP_COMPLETION_H_
#pragma once
void completion__init();
#endif /*WEECHAT_XMPP_COMPLETION_H*/

@ -10,9 +10,9 @@
#include "plugin.hh"
#include "account.hh"
#include "channel.hh"
#include "buffer.h"
#include "message.h"
#include "input.h"
#include "buffer.hh"
#include "message.hh"
#include "input.hh"
int input__data(struct t_gui_buffer *buffer, const char *text)
{
@ -85,5 +85,5 @@ int input__text_changed_cb(const void *pointer, void *data,
(void) signal;
(void) type_data;
return input__typing(signal_data);
return input__typing((struct t_gui_buffer*)signal_data);
}

@ -2,8 +2,7 @@
// License, version 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef _WEECHAT_XMPP_INPUT_H_
#define _WEECHAT_XMPP_INPUT_H_
#pragma once
int input__data_cb(const void *pointer, void *data,
struct t_gui_buffer *buffer,
@ -12,5 +11,3 @@ int input__data_cb(const void *pointer, void *data,
int input__text_changed_cb(const void *pointer, void *data,
const char *signal, const char *type_data,
void *signal_data);
#endif /*WEECHAT_XMPP_INPUT_H*/

@ -41,14 +41,14 @@ LIBDIR ?= $(PREFIX)/lib
HDRS=plugin.hh \
account.hh \
buffer.h \
buffer.hh \
channel.hh \
command.hh \
completion.h \
completion.hh \
config.hh \
connection.hh \
input.h \
message.h \
input.hh \
message.hh \
omemo.hh \
pgp.hh \
user.hh \
@ -57,14 +57,14 @@ HDRS=plugin.hh \
SRCS=plugin.cpp \
account.cpp \
buffer.c \
buffer.cpp \
channel.cpp \
command.cpp \
completion.c \
completion.cpp \
config.cpp \
connection.cpp \
input.c \
message.c \
input.cpp \
message.cpp \
omemo.cpp \
pgp.cpp \
user.cpp \

@ -14,7 +14,7 @@
#include "account.hh"
#include "channel.hh"
#include "user.hh"
#include "message.h"
#include "message.hh"
static const char format_regex[] = "<([^>]*?)>";
static const size_t max_groups = 2;
@ -93,13 +93,13 @@ char *message__translate_code(struct t_account *account,
symbol = strdup(code);
break;
}
free(identifier);
resultlen = snprintf(NULL, 0, "%s%s%s%s", weechat_color("chat_nick"), prefix, symbol, weechat_color("reset")) + 1;
result = malloc(resultlen);
result = (char*)malloc(resultlen);
snprintf(result, resultlen, "%s%s%s%s", weechat_color("chat_nick"), prefix, symbol, weechat_color("reset"));
free(symbol);
return result;
}
@ -170,7 +170,7 @@ char *message__decode(struct t_account *account,
return strdup(text);
}
decoded_text = malloc(MESSAGE_MAX_LENGTH);
decoded_text = (char*)malloc(MESSAGE_MAX_LENGTH);
if (!decoded_text)
{
regfree(&reg);

@ -2,12 +2,9 @@
// License, version 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef _WEECHAT_XMPP_MESSAGE_H_
#define _WEECHAT_XMPP_MESSAGE_H_
#pragma once
#define MESSAGE_MAX_LENGTH 40000
char *message__decode(struct t_account *account,
const char *text);
#endif /*WEECHAT_XMPP_MESSAGE_H*/

@ -15,9 +15,9 @@ extern "C" {
#include "account.hh"
#include "connection.hh"
#include "command.hh"
#include "input.h"
#include "buffer.h"
#include "completion.h"
#include "input.hh"
#include "buffer.hh"
#include "completion.hh"
WEECHAT_PLUGIN_NAME(WEECHAT_XMPP_PLUGIN_NAME);
WEECHAT_PLUGIN_DESCRIPTION(N_("XMPP client protocol"));

Binary file not shown.
Loading…
Cancel
Save