Coder Social home page Coder Social logo

junker / purple-xmpp-http-upload Goto Github PK

View Code? Open in Web Editor NEW
26.0 10.0 12.0 72 KB

HTTP File Upload plugin for libpurple (XMPP Protocol)

License: GNU General Public License v3.0

C 99.01% Makefile 0.99%
libpurple xmpp-protocol pidgin pidgin-plugins http

purple-xmpp-http-upload's Introduction

HTTP File Upload plugin for libpurple (XMPP Protocol)

XEP-0363: HTTP File Upload plugin for libpurple (Pidgin, Finch, etc.)

Installation

Linux, macOS

  1. Install the dependencies (libxml2-dev, libpurple-dev, libglib2.0-dev, libgio2.0-dev)
  2. git clone https://github.com/Junker/purple-xmpp-http-upload.git
  3. cd purple-xmpp-http-upload
  4. make
  5. A final make install should copy the plugin into your libpurple plugin dir.

Usage

click the "Conversation" menu, then "More" and select "HTTP file upload"

purple-xmpp-http-upload's People

Contributors

a-wai avatar eionrobb avatar fank avatar hasufell avatar jeremydrake-eac avatar junker avatar rufferson avatar yurcn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

purple-xmpp-http-upload's Issues

Create a release

This is useful for distributions to fetch static tarballs (which should be created via git archive and uploaded on the release page). Even git tags may change their content and break distro tarball caching.

Windows binary?

Is it possible to build a Windows binary of this plugin?

Regards,
Markus

Feature request: detect `lurch`, download and decrypt aesgcm:// media urls

I'm using a combination of plugins with Pidgin to make it a more up to date client, including this plugin and lurch for OMEMO.

In case OMEMO is enabled, the uploaded file itself should be encrypted as well. Is there a way to detect the existence of lurch and do the media encryption on upload?

(Note: I have modified this feature request after understanding that this module purely takes care of uploading, and has nothing to do with downloading.)

Different behaviour

If i send a image with the android app conversations, the image will be shown with image preview (looks like there is some meta data which shows that it is a image instead of plain text).
If i use pidgin with this module to send images, the url will be send as text and, not as image preview.
Is it possible to send the url as image instead of text?

Does not work over plain HTTP

XEP-0363 Version 0.7.0 (2018-05-30) says: "The host MUST provide Transport Layer Security", but older versions don't. Some servers do not provide TLS. This plugin does not work on servers providing the HTTP upload service over plain HTTP.
I'd gladly contribute a solution but I'm stuck at radiocane/purple-xmpp-http-upload@9c8fcfe

Build error

Hi,

Great plugin. I use it actively. Unfortunately, it cannot be build on the latest openSUSE Tumbleweed. collect2 returns the following error:

/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/ccfemtCN.o:/home/dante/git_ext/purple-xmpp-http-upload/src/jabber_http_file_upload.h:19: multiple definition of `HFUJabberStreamDataTable'; /tmp/cccszgAP.o:/home/dante/git_ext/purple-xmpp-http-upload/src/jabber_http_file_upload.h:19: first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:34: jabber_http_file_upload.so] Error 1

Any help is appreciated.

Ubuntu 16.04: Warnings while building and nothing gets copied to ~/.purple/plugins

make ; make install

cc  -Wall -I. -g -pipe -fPIC -pthread -I/usr/include/libpurple -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -I./headers/jabber src/hfu_disco.c src/hfu_util.c src/jabber_http_file_upload.c -o jabber_http_file_upload.so -g -pipe -fPIC -pthread -I/usr/include/libpurple -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -I./headers/jabber -lgio-2.0 -lgobject-2.0 -lpurple -lglib-2.0  -lxml2 -L/usr/lib/purple-2 -ldl -lm -ljabber -shared
src/jabber_http_file_upload.c: In function ‘jabber_hfu_http_send_connect_cb’:
src/jabber_http_file_upload.c:82:31: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t {aka unsigned int}’ [-Wformat=]
     headers = g_strdup_printf("PUT /%s HTTP/1.0\r\n"
                               ^
src/jabber_http_file_upload.c: In function ‘jabber_hfu_send_request’:
src/jabber_http_file_upload.c:210:32: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t {aka unsigned int}’ [-Wformat=]
     filesize = g_strdup_printf("%lu", purple_xfer_get_size(xfer));
                                ^
In file included from src/jabber_http_file_upload.c:7:0:
src/jabber_http_file_upload.c: In function ‘jabber_hfu_xfer_init’:
src/jabber_http_file_upload.c:339:40: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘gsize {aka unsigned int}’ [-Wformat=]
         gchar *msg = g_strdup_printf(_("HTTP File Upload maximum file size is %lu bytes"), js_data->max_file_size);
                                        ^
/usr/include/glib-2.0/glib/gi18n.h:26:29: note: in definition of macro ‘_’
 #define  _(String) gettext (String)
                             ^
mkdir -m 0755 -p /usr/lib/purple-2
install -m 0644 jabber_http_file_upload.so /usr/lib/purple-2/jabber_http_file_upload.so

should I be able to drag and drop?

compiled and installed without errors, I have it enabled, but don't know how to use it!

Pidgin_XEP-0363

I tried dragging a file from gui file manager.

Install Depedencies

I am using RHEL7.4. Can you please tell me how to install the dependencies mentioned. I am getting "fatal error" message during make file.

Package purple was not found in the pkg-config search path
perhaps you should add the directory containing 'purple.pc' to the PKG_CONFIG_PATH environment variable.

Larger files fails to transfer

Smaller files (max 136kb) will be transfered and uploaded successfully.
Larger files (>1.3mb) will be transfered and uploaded successfully (in gui only), serverside the connection closes and nothing is uploaded.

small file, log from prosody server:

Given upload slot "waeFqqVOMmQ8x2Tb/Screenshot from 2017-05-13 15-26-41.png"
File uploaded by USER to slot waeFqqVOMmQ8x2Tb

larger file, log from prosody server:

Given upload slot "lUBqVGUpRJdDKmtB/Screenshot from 2017-04-26 16-38-41.png"
server.lua: client 84.169.148.114:40182 read error: closed
server.lua: closed client handler and removed socket from list

I tried something but i'm unable to debug this issue.

Does not detect prosody + mod_http_upload_external

XEP enabled not on component, but on main server realm.

<iq from='[email protected]/test' id='step_01' to='domain.tld' type='get'>
  	<query xmlns='http://jabber.org/protocol/disco#items'/>

</iq>
<iq id='step_01' type='result' to='[email protected]/1debe043-3bc3-4866-9731-7ef7525d69fe' from='domain.tld'>
	<query xmlns='http://jabber.org/protocol/disco#items'>
		<item jid='skype.domain.tld'/>
		<item jid='proxy.domain.tld'/>
		<item jid='fb.domain.tld'/>
		<item jid='chat.domain.tld'/>
		<item jid='pubsub.domain.tld'/>
		<item jid='vk.domain.tld'/>
		<item jid='icq.domain.tld'/>
		<item jid='mra.domain.tld'/>
	</query>
</iq>
<iq from='[email protected]/test' id='step_02' to='domain.tld' type='get'>
  	<query xmlns='http://jabber.org/protocol/disco#info'/>

</iq>
<iq id='step_02' type='result' to='[email protected]/1debe043-3bc3-4866-9731-7ef7525d69fe' from='domain.tld'>
	<query xmlns='http://jabber.org/protocol/disco#info'>
		<identity type='pep' name='Prosody' category='pubsub'/>
		<identity type='file' name='HTTP File Upload' category='store'/>
		<identity type='im' name='Prosody' category='server'/>
		<feature var='urn:xmpp:blocking'/>
		<feature var='http://jabber.org/protocol/commands'/>
		<feature var='urn:xmpp:mam:0'/>
		<feature var='http://jabber.org/protocol/pubsub#publish'/>
		<feature var='msgoffline'/>
		<feature var='urn:xmpp:carbons:2'/>
		<feature var='urn:xmpp:carbons:1'/>
		<feature var='jabber:iq:register'/>
		<feature var='vcard-temp'/>
		<feature var='jabber:iq:roster'/>
		<feature var='urn:xmpp:time'/>
		<feature var='jabber:iq:time'/>
		<feature var='urn:xmpp:http:upload'/>
		<feature var='urn:xmpp:ping'/>
		<feature var='http://jabber.org/protocol/disco#info'/>
		<feature var='http://jabber.org/protocol/disco#items'/>
		<feature var='jabber:iq:private'/>
		<feature var='jabber:iq:version'/>
		<feature var='jabber:iq:last'/>
		<x xmlns='jabber:x:data' type='result'>
			<field type='hidden' var='FORM_TYPE'>
				<value>urn:xmpp:http:upload</value>
			</field>
			<field type='text-single' var='max-file-size'>
				<value>104857600</value>
			</field>
		</x>
	</query>
</iq>

Pidgin reports "HTTP File Upload is not supported by server".

Module built from current source, prosody and mod_http_upload_external from official repo.

Doesn't build

Hi, it doesn't build on CentOS 7, see below:

purple-xmpp-http-upload]$ make
cc -Wall -I. -g -pipe -fPIC -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libpurple -I/usr/include/libxml2 -I./headers/jabber src/hfu_disco.c src/hfu_util.c src/jabber_http_file_upload.c -o jabber_http_file_upload.so -g -pipe -fPIC -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libpurple -I/usr/include/libxml2 -I./headers/jabber -lgio-2.0 -lgobject-2.0 -lpurple -lglib-2.0 -lxml2 -lz -lm -ldl -L/usr/lib64/purple-2 -ldl -lm -ljabber -shared
/usr/bin/ld: cannot find -ljabber
collect2: error: ld returned 1 exit status
make: *** [jabber_http_file_upload.so] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.