maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Pidgin N900 Questions (https://talk.maemo.org/showthread.php?t=38483)

droll 2010-07-13 05:35

Re: Pidgin N900 Questions
 
it doesn't exist unless you use SIP but that may not work properly with an OCS server. ah well.......back to the drawing board.

torspo 2010-08-10 10:29

Re: Pidgin N900 Questions
 
Quote:

Originally Posted by b666m (Post 743929)
here you go:
EDIT1: Code updated because of false indents

Bump for Pidgin plugin of vibrator and the notifier.

izzox 2010-08-14 18:19

Re: Pidgin N900 Questions
 
Quote:

Originally Posted by b666m (Post 730021)
i think the script is pretty done now.

last changes:
- notification uses the alias of the contact
-> if no alias is defined/available (when the contact isn't in your list for example) the account/id will be used - in icq: the number; in msn and xmpp: the first part of the email (@... is cut off)
- the protocol now is set into brackets behind the alias/account/id
- the messages are now clear of formatting. xmpp: <body> tag is removed; msn: <FONT> tag is removed
(the rest is the same as mentioned above in the new stuff area)

SCREENSHOT:
http://img85.imageshack.us/img85/527...0062612374.png

and here's the code:
Code:

#!/usr/bin/env python

def cb (Notification=None, action=None, Data=None):
        pass

def my_func(account, sender, message, conversation, flags):

        if bus.pidginbus.PurpleConversationHasFocus(conversation) == 0:

                name = str(sender.split("@")[0])
                buddy = bus.pidginbus.PurpleFindBuddy(account,name)
                alias = bus.pidginbus.PurpleBuddyGetAlias(buddy)
                #icon = bus.pidginbus.PurpleBuddyGetIcon(buddy)
                #icon_path = bus.pidginbus.PurpleBuddyIconGetFullPath(icon)
                proto = bus.pidginbus.PurpleAccountGetProtocolName(account)
                #proid = bus.pidginbus.PurpleAccountGetProtocolId(account)
                conv = str(conversation)

                if alias == "":
                        alias = name

                msg = message

                if proto == "XMPP":
                        msg = msg[6:-7]
               
                elif proto == "MSN":
                        col = msg.find("COLOR")
                        if col > -1:
                                msg = msg[col+16:-14]

                msg = msg.replace("\n"," ")
                msg = "\""+msg
                if len(msg) > 32:
                        msg = msg[:33]+"...\""
                else:
                        msg = msg+"\""                       

                #print alias, "("+sender+") said \""+message+"\" in proto", proto, proid
                #with icon at", icon_path, "in conv", conv

                # it's only commented out for test-reasons because i only try it on ubuntu and console with print
                pynotify.init(os.path.splitext(os.path.basename(sys.argv[0]))[0])
                n = pynotify.Notification(alias+" ("+proto+")",msg,"pidgin")
                # -------------------------
                # maybe the next two lines can be used for bringing the conversation window to the foreground
                # when the notification is being clicked by the user
                # if that is not possible: comment them out or delete them (no use for them)
                n.set_hint_string("dbus-callback-default","im.pidgin.purple.PurpleService /im/pidgin/purple/PurpleObject im.pidgin.purple.PurpleInterface purple_conversation_present int32:"+conv)
#                n.set_hint_string("dbus-callback-default","com.nokia.osso_browser /com/nokia/osso_browser com.nokia.osso_browser open_new_window string:\"callto://666\"")
                n.add_action("default", "im", cb)
                n.set_timeout(3000)
                # or do i have to make an "add_action" for the notification?
                # maybe i can just put three NULL arguments there ^^
                # ------------------------
                n.show()

import os
import sys
import gobject, dbus
import pynotify

from dbus.mainloop.glib import DBusGMainLoop

dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
bus.pidginbus = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")

bus.add_signal_receiver(my_func,
                        dbus_interface="im.pidgin.purple.PurpleInterface",
                        signal_name="ReceivedImMsg")

loop = gobject.MainLoop()
loop.run()

i think i will take a look into how to autostart/end the script on pidgin start/end.

BTW: it also works on my ubuntu-laptop :D

http://img696.imageshack.us/img696/2...irmfoto3bv.png



Does it work for OS2008?

Bizzey 2010-08-18 15:09

Re: Pidgin N900 Questions
 
Quote:

Originally Posted by torspo (Post 781372)
Bump for Pidgin plugin of vibrator and the notifier.

yeah, i hope someone makin this into a pidgin plugin, ive been followin this threat ever since the python code been posted

jaeezzy 2010-08-23 12:53

Re: Pidgin N900 Questions
 
Hi, I'm using 2.7.3 and I tried to add Facebook IM but after putting in username and password and clicking "Add" button it freezes for ever... and clicking outer side gives me the message if I want to quit pidgin as its not respondin. Any help would be great thanks.

fareed_xtreme 2010-08-30 21:45

Re: Pidgin N900 Questions
 
I had a small question... I wanted to know, how i can disable Pidgin auto login. I do not prefer that it logs in directly to my IMs when i connect to some network. Isthis actually normal or is this a problem I am facing? How can I fix this?

Thanks...

Scorpius 2010-09-11 00:45

Re: Pidgin N900 Questions
 
I modified the pidgin-libnotify plugin (since Maemo uses a libnotify compatible notification daemon) so it shows the very same notifications the python script does and also makes the phone vibrate.

I guess if anyone is interested I could create a .deb package an upload it to extras-devel or extra-testing.

mesho123 2010-09-13 16:23

Re: Pidgin N900 Questions
 
hi

what is the final code and if there is way to make the pidgin to vibrate ?


thank you

Scorpius 2010-09-13 22:34

Re: Pidgin N900 Questions
 
Quote:

Originally Posted by mesho123 (Post 815002)
hi

what is the final code and if there is way to make the pidgin to vibrate ?


thank you

The vibration is on by default but you can disable it in the plugin configuration screen if you want.

Go to this thread:
http://talk.maemo.org/showpost.php?p...8&postcount=13

MOST_WANTED 2010-12-09 06:35

Re: Pidgin N900 Questions
 
Im having Pidgin 2.7.7 Bos server problem does anyone else has it ?! and how to solve it ?, it says : Unable to connect to BOS server: SSL Handshake Failed...plz help !!!:(


All times are GMT. The time now is 00:53.

vBulletin® Version 3.8.8