Pidgin should refresh active accounts after coming back from suspend/hibernate

Bug #135886 reported by Kristoffer Lundén
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pidgin (Ubuntu)
Fix Released
Wishlist
Unassigned
pm-utils (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: pidgin

When coming back from suspend, the contact list is stale and it takes a really long time for pidgin to realize that it has been sleeping and things have changed. It would be nice if pidgin got a message (via D-Bus?) that it would be appropriate to refresh now. NetworkManager picked up my new location beautifully after resuming, but the contact list remains stale for a long time unless I go offline/online manually.

Revision history for this message
Chris Jones (cmsj) wrote :

afaik network-manager does produce the required dbus signal, pidgin just needs to listen to it.

Changed in pidgin:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
KraetziChriZ (christian.b) wrote :

hmmm, must pidgin compiled against this feature?
Its a nice feature :)

Revision history for this message
aneiser (andreas-neiser) wrote :

I added the package pm-utils, too. A possible workaround or true bugfix would be to integrate the following script in pm-utils (found it here: http://forum.ubuntuusers.de/topic/136999/):

#!/bin/bash

get_env_var_of_process() {
  local pid="$1" envvar="$2"

  cat /proc/$pid/environ | tr '\0' '\n' | sed -ne 's/^'"$envvar"'=\(.*\)$/\1/p'
}

send_dbus_msg_to_pidgin() {
  local msg="$1"

  for pid in `pidof pidgin`; do
    user=$(get_env_var_of_process $pid USER)
    session_bus_address=$(get_env_var_of_process $pid DBUS_SESSION_BUS_ADDRESS)
    DBUS_SESSION_BUS_ADDRESS="$session_bus_address" su "$user" -c "purple-remote $msg" | logger
  done
}

case "$1" in
  hibernate|suspend)
    logger "Setting Pidgin offline..."
    send_dbus_msg_to_pidgin "setstatus\?status=offline" | logger
    ;;

  thaw|resume)
    logger "Reanimating Piding..."
    send_dbus_msg_to_pidgin "setstatus\?status=available" | logger
    ;;

  *)
    send_dbus_msg_to_pidgin "jabber:getinfo\?screenname=foosel\@via.im" | logger
    ;;

esac

exit $?

Just create it in /etc/pm and add some symbolic links in /etc/pm/sleep.d and /etc/pm/power.d, don't forget to chmod +x it ;)

Revision history for this message
vlowther (victor-lowther) wrote :

This is very pidgin specific, and should not be added to pm-utils. Adding it to the pidgin package would be the best course of action.

Revision history for this message
Leonard Michlmayr (leonard-michlmayr) wrote : Pidgin not noticing down network interface

I have a similar problem, but not only with PM but also with the modem:

(I use pidgin for MSN)

When I lose a modem connection, the network interface ppp0 goes down. NetworkManager doesn't report the network being down, because other network interfaces are still active (e.g. intranet). So, pidgin ignores the interface ppp0 going down and it keeps the TCP connection. Note: it keeps the tcp-connection with a host address that is not active anymore.

This may be fine, because we should not drop a connection just because the IF is down. However, I would expect pidgin to open a new connection as soon as an interface with an internet connection becomes available. Be it that I plug an ethernet cable to eth0, be it that I reconnect the modem and get a NEW IP-address.

Instead pidgin just keeps the old connection and pretends online state, although it isn't, actually.

I think pidgin should behave the following way:
 1 keep an active connection even if the interface is down (as it does now)
 2 mark the account as being offline, if there is NO active connection with an active interface
 3 as soon as there is a new network interface with a route to the servers, try to get a connection, at least if we are offline because of rule 2
 4 drop old connections of inactive interfaces as soon as there is a new active connection that can be used

Maybe this is a network-manager issue, too. Anyway, I think it is very important for pidgin.

Revision history for this message
Tarnay Kálmán (tarnay-kalman) wrote :

Aneiser's suggestion solves THIS problen perfectly... (and vlowther is right)
(I think) that Leonard Michlmayr should report "his bug" in a new bug report.

btw what's the point of this line?
"send_dbus_msg_to_pidgin "jabber:getinfo\?screenname=foosel\@via.im" | logger"

Changed in pm-utils:
status: New → Invalid
Revision history for this message
Sebastien Bacher (seb128) wrote :

the current version in jaunty uses nm correctly closing the bug

Changed in pidgin (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
ssuuddoo (ssuuddoo) wrote :

in natty the problem remains. on resume after a succesful sleep, the pidgin tries 2 connect, but does not succeed.
will try to use the suggested solution. thnx

Revision history for this message
ssuuddoo (ssuuddoo) wrote :

itworks. thnx

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.